Hi Jayesh,<br><br>I now have,<br><br>#include &lt;windows.h&gt;<br>#include &lt;mpi.h&gt;<br><br>But I&#39;m getting the following errors now -<br><br>C:\C_code&gt;&quot;C:\Documents and Settings\Administrator\Desktop\mingw-w64-bin-x86_64-<br>
20100131\mingw64\bin\gcc.exe&quot; -I &quot;C:\Program Files\MPICH2\include&quot; -L &quot;C:\Progra<br>m Files\MPICH2\lib&quot; prog.c -lmpi<br>C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\ccG2CWiZ.o:prog.c:(.text+0<br>xd7): undefined reference to `MPI_Init&#39;<br>
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\ccG2CWiZ.o:prog.c:(.text+0<br>xe1): undefined reference to `MPI_Barrier&#39;<br>C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\ccG2CWiZ.o:prog.c:(.text+0<br>xe6): undefined reference to `MPI_Wtime&#39;<br>
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\ccG2CWiZ.o:prog.c:(.text+0<br>x108): undefined reference to `MPI_Comm_rank&#39;<br>C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\ccG2CWiZ.o:prog.c:(.text+0<br>x119): undefined reference to `MPI_Comm_size&#39;<br>
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\ccG2CWiZ.o:prog.c:(.text+0<br>x143): undefined reference to `MPI_Finalize&#39;<br>C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\ccG2CWiZ.o:prog.c:(.text+0<br>x242): undefined reference to `MPI_Finalize&#39;<br>
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\ccG2CWiZ.o:prog.c:(.text+0<br>x274): undefined reference to `MPI_Finalize&#39;<br>C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\ccG2CWiZ.o:prog.c:(.text+0<br>x39e): undefined reference to `MPI_Bcast&#39;<br>
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\ccG2CWiZ.o:prog.c:(.text+0<br>x424): undefined reference to `MPI_Reduce&#39;<br>C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\ccG2CWiZ.o:prog.c:(.text+0<br>x429): undefined reference to `MPI_Wtime&#39;<br>
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\ccG2CWiZ.o:prog.c:(.text+0<br>x48e): undefined reference to `MPI_Finalize&#39;<br>collect2: ld returned 1 exit status<br><br>Thanks for helping!<br>Sanchay<br><br><div class="gmail_quote">
On Mon, Feb 22, 2010 at 4:20 PM, Jayesh Krishna <span dir="ltr">&lt;<a href="mailto:jayesh@mcs.anl.gov">jayesh@mcs.anl.gov</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi,<br>
 Try including &quot;windows.h&quot; in your MPI program (before including mpi.h) and let us know if it works for you.<br>
<br>
Regards,<br>
<font color="#888888">Jayesh<br>
</font><div><div></div><div class="h5">----- Original Message -----<br>
From: &quot;Sanchay Harneja&quot; &lt;<a href="mailto:sanchay.h@gmail.com">sanchay.h@gmail.com</a>&gt;<br>
To: <a href="mailto:mpich-discuss@mcs.anl.gov">mpich-discuss@mcs.anl.gov</a><br>
Sent: Sunday, February 21, 2010 5:16:16 PM GMT -06:00 US/Canada Central<br>
Subject: [mpich-discuss] Trouble compiling MPICH2 (mpich2-1.2.1-win-x86-64) with mingw-w64<br>
<br>
<br>
Hi,<br>
<br>
I&#39;m trying to compile a C program on Windows XP 64 bit with the mingw-w64 compiler. But I&#39;m getting errors as follows.<br>
<br>
I downloaded the MPICH2 lib from: <a href="http://www.mcs.anl.gov/research/projects/mpich2/" target="_blank">http://www.mcs.anl.gov/research/projects/mpich2/</a> .<br>
And downloaded the mingw compiler from: <a href="http://www.drangon.org/mingw/" target="_blank">http://www.drangon.org/mingw/</a> (mingw-w64-bin-x86_64-20100131.7z)<br>
<br>
Note that the program compiles successfully with the 32 bit mingw compiler and the 32 bit MPICH2 (mpich2-1.2.1-win-ia32.msi).<br>
<br>
C:\C_code&gt;&quot;C:\Documents and Settings\Administrator\Desktop\mingw-w64-bin-x86_64-<br>
20100131\mingw64\bin\gcc.exe&quot; -I &quot;C:\Program Files\MPICH2\include&quot; -L &quot;C:\Progra<br>
m Files\MPICH2\lib&quot; prog.c -lmpi<br>
In file included from prog.c:16:0:<br>
C:\Program Files\MPICH2\include/mpi.h:360:17: error: expected &#39;=&#39;, &#39;,&#39;, &#39;;&#39;, &#39;as<br>
m&#39; or &#39;__attribute__&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:550:66: error: expected declaration specif<br>
iers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:608:32: error: expected declaration specif<br>
iers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:610:35: error: expected declaration specif<br>
iers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:611:33: error: expected declaration specif<br>
iers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:612:24: error: expected declaration specif<br>
iers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:614:35: error: expected declaration specif<br>
iers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:620:31: error: expected declaration specif<br>
iers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:621:31: error: expected declaration specif<br>
iers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:736:52: error: expected declaration specif<br>
iers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:738:45: error: expected declaration specif<br>
iers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:740:45: error: expected declaration specif<br>
iers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:743:28: error: expected declaration specif<br>
iers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:788:64: error: expected declaration specif<br>
iers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:825:29: error: expected &#39;)&#39; before &#39;MPI_In<br>
fo&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:834:29: error: expected declaration specif<br>
iers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:844:66: error: expected declaration specif<br>
iers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:845:23: error: expected declaration specif<br>
iers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:846:55: error: expected declaration specif<br>
iers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:852:43: error: expected declaration specif<br>
iers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:854:39: error: expected declaration specif<br>
iers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:857:43: error: expected declaration specif<br>
iers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:857:53: error: expected declaration specif<br>
iers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:858:41: error: expected declaration specif<br>
iers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:862:39: error: expected declaration specif<br>
iers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:862:51: error: expected declaration specif<br>
iers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:863:44: error: expected declaration specif<br>
iers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:863:56: error: expected declaration specif<br>
iers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:864:41: error: expected declaration specif<br>
iers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:864:51: error: expected declaration specif<br>
iers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
In file included from prog.c:16:0:<br>
C:\Program Files\MPICH2\include/mpi.h:930:33: error: expected declaration specif<br>
iers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:932:36: error: expected declaration specif<br>
iers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:933:34: error: expected declaration specif<br>
iers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:934:25: error: expected declaration specif<br>
iers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:935:36: error: expected declaration specif<br>
iers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:937:32: error: expected declaration specif<br>
iers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:938:32: error: expected declaration specif<br>
iers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:1043:53: error: expected declaration speci<br>
fiers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:1045:46: error: expected declaration speci<br>
fiers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:1047:46: error: expected declaration speci<br>
fiers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:1050:29: error: expected declaration speci<br>
fiers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:1095:65: error: expected declaration speci<br>
fiers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:1120:30: error: expected &#39;)&#39; before &#39;MPI_I<br>
nfo&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:1129:30: error: expected declaration speci<br>
fiers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:1139:67: error: expected declaration speci<br>
fiers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:1140:23: error: expected declaration speci<br>
fiers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:1141:56: error: expected declaration speci<br>
fiers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:1147:44: error: expected declaration speci<br>
fiers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:1149:40: error: expected declaration speci<br>
fiers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:1152:44: error: expected declaration speci<br>
fiers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:1152:54: error: expected declaration speci<br>
fiers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:1153:42: error: expected declaration speci<br>
fiers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:1157:40: error: expected declaration speci<br>
fiers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:1157:52: error: expected declaration speci<br>
fiers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:1158:45: error: expected declaration speci<br>
fiers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:1158:57: error: expected declaration speci<br>
fiers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:1159:42: error: expected declaration speci<br>
fiers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpi.h:1159:52: error: expected declaration speci<br>
fiers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
In file included from C:\Program Files\MPICH2\include/mpi.h:1186:0,<br>
from prog.c:16:<br>
C:\Program Files\MPICH2\include/mpio.h:206:54: error: expected declaration speci<br>
fiers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
C:\Program Files\MPICH2\include/mpio.h:391:55: error: expected declaration speci<br>
fiers or &#39;...&#39; before &#39;MPI_Aint&#39;<br>
prog.c: In function &#39;main&#39;:<br>
prog.c:69:9: warning: incompatible implicit declaration of bu<br>
ilt-in function &#39;exit&#39;<br>
prog.c:90:9: warning: incompatible implicit declaration of bu<br>
ilt-in function &#39;exit&#39;<br>
prog.c:97:23: warning: incompatible implicit declaration of b<br>
uilt-in function &#39;malloc&#39;<br>
prog.c:104:9: warning: incompatible implicit declaration of b<br>
uilt-in function &#39;exit&#39;<br>
<br>
C:\C_code&gt;<br>
<br>
Thanks!<br>
Sanchay<br>
<br>
</div></div><div><div></div><div class="h5">_______________________________________________<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>
</div></div></blockquote></div><br>