[MPICH2-dev] Linking issues on Windows

John Vert jvert at windows.microsoft.com
Mon Apr 24 19:20:29 CDT 2006


Your application is built with stdcall as the default calling
convention. (/Gz)

The Windows binary distribution of MPICH2 is built with cdecl as the
default calling convention (/Gd)

Unfortunately the MPICH2 mpi.h does not specify the calling convention
in the function prototypes, so you get this error at link time because
of the calling convention mismatch.

 

To fix this you can either change your project to build with /Gd,
rebuild MPICH2 with /Gz as the default calling convention, or edit mpi.h
to include __cdecl in the function prototypes.

    -John

 

________________________________

From: owner-mpich2-dev at mcs.anl.gov [mailto:owner-mpich2-dev at mcs.anl.gov]
On Behalf Of Shankar, Shashank (US - New York)
Sent: Monday, April 24, 2006 4:24 PM
To: mpich2-dev at mcs.anl.gov
Subject: [MPICH2-dev] Linking issues on Windows

 

Hello, 

I am trying to develop a distributed application utilizing MPI as the
communication mechanism, and have run into linking issues. The
application that I am working on is for the Windows platform, and I am
using the C++ VS.NET 2003 IDE. The application is a console based
application and it compiles successfully, but I get the following
messages on the link phase:

Compiling... 
LCSlave.cpp 
Linking... 
LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other
libs; use /NODEFAULTLIB:library 
LCSlave.obj : error LNK2019: unresolved external symbol _MPI_Comm_rank at 8
referenced in function "void __stdcall fn_mpi_init(int,char * * const)"
(?fn_mpi_init@@YGXHQAPAD at Z)

LCSlave.obj : error LNK2019: unresolved external symbol _MPI_Init at 8
referenced in function "void __stdcall fn_mpi_init(int,char * * const)"
(?fn_mpi_init@@YGXHQAPAD at Z)

LCSlave.obj : error LNK2019: unresolved external symbol _MPI_Recv at 28
referenced in function "void __stdcall
fn_mpi_send_recieve_proj_term_y(void)"
(?fn_mpi_send_recieve_proj_term_y@@YGXXZ)

LCSlave.obj : error LNK2019: unresolved external symbol _MPI_Send at 24
referenced in function "void __stdcall
fn_mpi_send_recieve_proj_term_y(void)"
(?fn_mpi_send_recieve_proj_term_y@@YGXXZ)

LCSlave.obj : error LNK2019: unresolved external symbol
_MPI_Type_commit at 4 referenced in function "void __stdcall
fn_mpi_define_custom(void)" (?fn_mpi_define_custom@@YGXXZ)

LCSlave.obj : error LNK2019: unresolved external symbol
_MPI_Type_struct at 20 referenced in function "void __stdcall
fn_mpi_define_custom(void)" (?fn_mpi_define_custom@@YGXXZ)

LCSlave.obj : error LNK2019: unresolved external symbol _MPI_Address at 8
referenced in function "void __stdcall fn_mpi_define_custom(void)"
(?fn_mpi_define_custom@@YGXXZ)

Debug/LCSlave.exe : fatal error LNK1120: 7 unresolved externals 

Build log was saved at
"file://d:\stage\Prophet\Test\code\LCSlave\Debug\BuildLog.htm
<file:///d:\stage\Prophet\Test\code\LCSlave\Debug\BuildLog.htm> " 
LCSlave - 8 error(s), 1 warning(s) 

Any help, suggestions in this regards will be very appreciated. 

Thanks! 
Regards, 
Shashank Shankar
Consultant/Enterprise Business Integration/Technology Integration,
Deloitte Consulting LLP
Tel: +1 212 618 4702
Mobile: + 1 281 636 8712 

 

This message (including any attachments) contains confidential
information intended for a specific individual and purpose, and is
protected by law.  If you are not the intended recipient, you should
delete this message. 

Any disclosure, copying, or distribution of this message, or the taking
of any action based on it, is strictly prohibited. [v.E.1]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mcs.anl.gov/mailman/private/mpich2-dev/attachments/20060424/881f3616/attachment.htm>


More information about the mpich2-dev mailing list