[MPICH] Problems compiling MPICH2 programs on WinXP with gcc

Jellyworld me at jia-han.net
Thu Jan 26 22:46:35 CST 2006


I installed the Win32 version of MPICH2 into C:\Program Files\MPICH2 
yesterday, and I tried to compile icpi.c in the /mpich2/examples 
directory using gcc using the command

gcc -I"C:/Program Files/MPICH2/include"   -c -o mpi.o icpi.c

The compile worked fine, but when I tried to link it using

gcc -L"C:/Program Files/MPICH2/lib" -lmpi  mpi.o   -o mpi

but I get the following errors

mpi.o(.text+0x6d):mpi.c: undefined reference to `MPI_Init'
mpi.o(.text+0x80):mpi.c: undefined reference to `MPI_Comm_size'
mpi.o(.text+0x93):mpi.c: undefined reference to `MPI_Comm_rank'
mpi.o(.text+0xa8):mpi.c: undefined reference to `MPI_Get_processor_name'
mpi.o(.text+0x11c):mpi.c: undefined reference to `MPI_Wtime'
mpi.o(.text+0x14a):mpi.c: undefined reference to `MPI_Bcast'
mpi.o(.text+0x1eb):mpi.c: undefined reference to `MPI_Reduce'
mpi.o(.text+0x219):mpi.c: undefined reference to `MPI_Wtime'
mpi.o(.text+0x24c):mpi.c: undefined reference to `MPI_Finalize'
collect2: ld returned 1 exit status
make: *** [mpi] Error 1

I'm using gcc 3.4.2 (MINGW) which came with DEV-CPP.

Any help would be greatly appreciated.




More information about the mpich-discuss mailing list