我尝试设置 VS2017 来编写一些 MPI 程序,并添加了所有这些库,如本教程所示:
https://blogs.technet.microsoft.com/windowshpc/2015/02/02/how-to-compile-and-run-a-simple-ms-mpi-program/
并尝试运行简单的 MPI 代码:
#include <iostream>
#include <mpi.h>
#include "stdafx.h"
int main(int argc, char *argv[])
{
MPI_Init(&argc, &argv);
MPI_Finalize();
return 0;
}
当我构建时,它给我错误,找不到MPI_Init和MPI_Finalize标识符。怎么办?
#include "stdafx.h"
必须是第一个包含。忽略#include "stdafx.h"
之前的所有包含指令。