为 MPI 设置 Visual Studio:找不到标识符错误

Setting up Visual Studio for MPI : Identifier not found error

我尝试设置 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" 之前的所有包含指令都将被忽略。