If you want to compile from the command line instead of using the MS Integrated Development Environment, here are the compile and link commands copied from the cpi project in the examples directory.
Debug target: execute this:
cl.exe /nologo /MTd /W3 /GX /Od /I "C: Program Files MPICH SDK include" /D WIN32 /D _DEBUG /D _CONSOLE /D _MBCS /GZ /c example.c
Release target: execute this:
cl.exe /nologo /MT /W3 /GX /O2 /I "C: Program Files MPICH SDK include" /D WIN32 /D NDEBUG /D _CONSOLE /D _MBCS /c example.c
4. link example.obj:
Debug target: execute this:
link.exe ws2_32.lib mpichd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"example.exe" /pdbtype:sept /libpath:"C:\Program Files\MPICH\SDK\lib" example.objRelease target: execute this:
link.exe ws2_32.lib mpich.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"example.exe" /libpath:"C:\Program Files\MPICH\SDK\lib" example.objDepending on what functions example.c uses, you may not need all the libraries specified above.