[mpich-discuss] mpich2 with microsoft visual c++ 2010 express

Jayesh Krishna jayesh at mcs.anl.gov
Wed Mar 28 13:34:49 CDT 2012


Hi,
 You should specify the complete paths to MPICH2 include/lib directories. Try replacing "mpich2/include" with "C:\Program Files\MPICH2\include" etc.
 Also make sure that you are building a 64-bit binary when you are using 64-bit MPICH2 include/libs.

Regards,
Jayesh

----- Original Message -----
From: "Titianingrum -" <08.5831 at stis.ac.id>
To: mpich-discuss at mcs.anl.gov
Sent: Wednesday, March 28, 2012 1:12:18 PM
Subject: [mpich-discuss] mpich2 with microsoft visual c++ 2010 express



hi, 
i'm beginner mpi programmer. 



i try simple program use ide microsoft visual c++ 2010 express on windows 7 (64bit). 


code: 


#include "mpi.h" 
#include <stdio.h> 

int main (int argc,char* argv[]){ 
int numberOfProcessor; 
int rank; 
int namelen; 
char processor_name[MPI_MAX_PROCESSOR_NAME]; 

MPI_Init(&argc,&argv); 
printf("Hello MPI\r\n"); 

MPI_Comm_size(MPI_COMM_WORLD,&numberOfProcessor); 
printf("jumlah processor=%d\r\n",numberOfProcessor); 


MPI_Comm_rank(MPI_COMM_WORLD,&rank); 
printf("proses pada %d\r\n",rank); 

MPI_Finalize(); 
return 0; 
} 





for "Additional Include Directories" added by "mpich2/include", "Additional Library Directories" added by "mpich2/lib" and "Additional Dependencies" added "cxx.lib,mpe.lib,mpi.lib". 
but, if i debug this program, there's error : 


1>------ Build started: Project: HelloMPI2, Configuration: Debug Win32 ------ 
1>hello_mpi2.obj : error LNK2019: unresolved external symbol _MPI_Finalize referenced in function _main 
1>hello_mpi2.obj : error LNK2019: unresolved external symbol _MPI_Comm_rank referenced in function _main 
1>hello_mpi2.obj : error LNK2019: unresolved external symbol _MPI_Comm_size referenced in function _main 
1>hello_mpi2.obj : error LNK2019: unresolved external symbol _MPI_Init referenced in function _main 
1>C:\Users\titia\documents\visual studio 2010\Projects\HelloMPI2\Debug\HelloMPI2.exe : fatal error LNK1120: 4 unresolved externals 
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== 



I don't know what exactly went wrong with the process. 

Thanks. 

_______________________________________________
mpich-discuss mailing list     mpich-discuss at mcs.anl.gov
To manage subscription options or unsubscribe:
https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss


More information about the mpich-discuss mailing list