I believe you need -lmpicxx -lmpi on your command line.<br clear="all"><br>-- <br>Jim Hunziker<br>
<br><br><div class="gmail_quote">On Wed, Oct 6, 2010 at 6:26 AM, 孔涛 <span dir="ltr"><<a href="mailto:hawk_kongtao@yahoo.com.cn">hawk_kongtao@yahoo.com.cn</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div style="font-size:12pt;color:#000000"><div><font face="lucida console, sans-serif"></font></div>
<div>
<div><font face="lucida console, sans-serif">Hello, I have installed GCC & MPICH2-1.2.1p1 for windows with editplus 3 on my winows 7 platform. I configure them following the"README.winbin"file in mpich2.</font></div>
<div><font face="lucida console, sans-serif">and It works well with c/fortran.</font></div>
<div><font face="lucida console, sans-serif"> </font></div>
<div><font face="lucida console, sans-serif">but if i use the c++ mode, which means, using "MPI::Int(), MPI::COMM_WORLD.Getsize(),etc." instead of "MPI_Init(&argc,&argv),MPI_Comm_size(MPI_COMM_WORLD,&size).etc" , It failed .</font></div>
<div><font face="lucida console, sans-serif"> </font></div>
<div><font face="lucida console, sans-serif">If the source file has any grammar mistake, when compling, the g++ can point it out.</font></div>
<div><font face="lucida console, sans-serif"> </font></div>
<div><font face="lucida console, sans-serif">After I correct them, when I build them again, It shows :</font></div>
<div><font face="lucida console, sans-serif">-------------------------------------------------------------</font></div>
<div><font face="lucida console, sans-serif">C:\Users\Vikram\AppData\Local\Temp\ccKmyYIt.o:mpi_derived.cpp:(.text+0x5f): unde<br>fined reference to `MPI::Init()'<br>C:\Users\Vikram\AppData\Local\Temp\ccKmyYIt.o:mpi_derived.cpp:(.text+0x66): unde<br>
fined reference to `MPI::COMM_WORLD'<br>C:\Users\Vikram\AppData\Local\Temp\ccKmyYIt.o:mpi_derived.cpp:(.text+0x9c): unde<br>fined reference to `MPI::DOUBLE'<br>C:\Users\Vikram\AppData\Local\Temp\ccKmyYIt.o:mpi_derived.cpp:(.text+0x201): und<br>
efined reference to `MPI::COMM_WORLD'<br>C:\Users\Vikram\AppData\Local\Temp\ccKmyYIt.o:mpi_derived.cpp:(.text+0x233): und<br>efined reference to `MPI::COMM_WORLD'<br>C:\Users\Vikram\AppData\Local\Temp\ccKmyYIt.o:mpi_derived.cpp:(.text+0x26a): und<br>
efined reference to `MPI::COMM_WORLD'<br>C:\Users\Vikram\AppData\Local\Temp\ccKmyYIt.o:mpi_derived.cpp:(.text+0x316): und<br>efined reference to
`MPI::DOUBLE'<br>C:\Users\Vikram\AppData\Local\Temp\ccKmyYIt.o:mpi_derived.cpp:(.text+0x32c): und<br>efined reference to `MPI::COMM_WORLD'<br>C:\Users\Vikram\AppData\Local\Temp\ccKmyYIt.o:mpi_derived.cpp:(.text+0x3b7): und<br>
efined reference to `MPI::Finalize()'<br>C:\Users\Vikram\AppData\Local\Temp\ccKmyYIt.o:mpi_derived.cpp:(.text$_ZN3MPI8Dat<br>atypeC1Ev[MPI::Datatype::Datatype()]+0x8): undefined reference to `vtable for MP<br>I::Datatype'<br>
C:\Users\Vikram\AppData\Local\Temp\ccKmyYIt.o:mpi_derived.cpp:(.text$_ZN3MPI8Dat<br>atypeD1Ev[MPI::Datatype::~Datatype()]+0xb): undefined reference to `vtable for M<br>PI::Datatype'<br>collect2: ld returned 1 exit status<br>
Press any key to continue....</font></div>
<div><font face="lucida console, sans-serif">----------------------------------------------------------</font></div>
<div><font face="lucida console, sans-serif">However ,if I replace all the MPI::XXX kind (C++ mode )to MPI_XXX( C mode ), It works. Every thing is well</font></div>
<div><font face="lucida console, sans-serif">I don't know why, can you help me?</font></div>
<div><font face="lucida console, sans-serif"> </font></div>
<div><font face="lucida console, sans-serif">---</font></div>
<div><font face="lucida console, sans-serif">when compiling I use the following command:</font></div>
<div><font face="lucida console, sans-serif">g++ -I D:\MPICH2\include -L D:\MPICH2\lib $(FileName) -o $(FileNameNoExt) -lmpi</font></div>
<div><font face="lucida console, sans-serif"> </font></div>
<div><font face="lucida console, sans-serif">---</font></div>
<div><font face="lucida console, sans-serif">Waiting for your Reply. Wish everything well for you!</font></div><br><font face="lucida console, sans-serif"> </font></div>
<div><font face="lucida console, sans-serif"><font size="2">------</font><font size="2">---------------------------------------------</font></font></div>
<div><font face="lucida console, sans-serif"><font style="font-family:tahoma, new york, times, serif;font-weight:bold" size="2">孔涛</font><font style="font-family:arial, helvetica, sans-serif" size="2"> </font><font size="2"> 山东大学数学学院</font></font></div>
<div><font face="lucida console, sans-serif"></font></div></div><br>
</div><br>_______________________________________________<br>
mpich-discuss mailing list<br>
<a href="mailto:mpich-discuss@mcs.anl.gov">mpich-discuss@mcs.anl.gov</a><br>
<a href="https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss" target="_blank">https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss</a><br>
<br></blockquote></div><br>