0

安装 HPC pack 2012 并使用 MPI 包配置 HPC pack 2012 microsoft visual studio 后,现在我正在尝试编译此代码

#include <mpi.h>
#include <stdio.h>
using namespace std;
int main( )
{
// Initialize the MPI environment
MPI_Init(NULL, NULL);
// Get the number of processes
int NP;
MPI_Comm_size(MPI_COMM_WORLD, &NP);
// Get the rank of the process “ID”
int id;
MPI_Comm_rank(MPI_COMM_WORLD, &id);
// Print off a hello world message
printf("Hello world from processor %d \n", id);
// Finalize the MPI environment.
MPI_Finalize();
}

但我有这个错误

2 error C2059: syntax error:')'                                                
5 error C2059: syntax error :')'        
1 error C2061: syntax error : identifier '_Out_writes_' 
4 error C2061: syntax error : identifier '_Out_writes_'     
3 error C2143: syntax error : missing ')' before ';'    
6 error C2143: syntax error : missing ')' before ';'    
9 IntelliSense: expected a ')'                                  
12 IntelliSense: expected a ')'                                     
8 IntelliSense: identifier "command" is undefined   
11 IntelliSense: identifier "command" is undefined     
7 IntelliSense: type name is not allowed     
10 IntelliSense: type name is not allowed   
4

0 回答 0