[mpich-discuss] Compiling an app with MPICH2

Marco Mura mura at di.unipi.it
Thu Sep 2 19:18:23 CDT 2010


Solved... I had to compile it as a 64bit application...

Marco

________________________________________
From: Marco Mura
Sent: Friday, September 03, 2010 1:59 AM
To: mpich-discuss at mcs.anl.gov
Cc: Marco Mura
Subject: Compiling an app with MPICH2

Hi,
I don't reach to compile an MPI application using the mpich2 mpi.lib; it gives me linking errors that it doesn't find the mpi functions:
"unresolved external symbol _MPI_Init referenced in function _main".

I'm using VS2010 in Win7 64 bit.

In detail, I installed the package (1.2.1p1) for windows:
http://www.mcs.anl.gov/research/projects/mpich2/downloads/tarballs/1.2.1p1/mpich2-1.2.1p1-win-x86-64.msi
then I created a new project in VS2010, added a simple main.cpp file with this code:

#include "mpi.h"
int main(int argc, char **argv)
{
 int rank, size;
 MPI_Init(&argc, &argv);
 MPI_Comm_size(MPI_COMM_WORLD, &size);
 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
 MPI_Finalize();
 return 0;
}

and I added the path "C:\Program Files\MPICH2\include" for includes and "C:\Program Files\MPICH2\lib\mpi.dll" as addictionary dependency. It just doesn't work like it don't link mpi.dll...
(but I think that it is linked because if I try to specify a wrong name like mpifff.dll which doesn't exists the linker returns me that it doesn't find the library... and with mpi.dll it doesn't do that).

Do you have any suggestion?

Thanks,
Marco


More information about the mpich-discuss mailing list