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

Titianingrum - 08.5831 at stis.ac.id
Wed Mar 28 13:12:18 CDT 2012


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/mpich-discuss/attachments/20120329/f5fdc569/attachment.htm>


More information about the mpich-discuss mailing list