title: How can I use mpich2 in visual studio 2012
body: <p>I am trying to use mpich2 in visual studio 2012.</p>
  
  <p>I found and followed a <a href="http://nick-goodman.blogspot.co.uk/2012/02/using-mpich-from-ms-visual-studio-2010.html" rel="nofollow noreferrer">tutorial</a>.</p>
  
  <p>However I am getting following errors:</p>
  
  <pre><code>1&gt;HelloWorld.obj : error LNK2019: unresolved external symbol _MPI_Init referenced in function _main
  1&gt;HelloWorld.obj : error LNK2019: unresolved external symbol _MPI_Finalize referenced in function _main
  1&gt;D:\C Projects\HelloWorldMPI\Debug\HelloWorldMPI.exe : fatal error LNK1120: 2 unresolved externals
  </code></pre>
  
  <p>My code is basic hello world code.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;mpi.h&gt;
  
  main(int argc, char **argv)
  {
     int node;
     //
     MPI_Init(&amp;argc,&amp;argv);
     //MPI_Comm_rank(MPI_COMM_WORLD, &amp;node);
     //  
     //printf("Hello World from Node %d\n",node);
     //         
     MPI_Finalize();
  }
  </code></pre>
  
  <p>By the way I can see mpi.h header with rigth clicking  and clicking to open document. So program can find mpi.h header.</p>
  
  <p>Edit: </p>
  
  <p>The the way I linked library.</p>
  
  <p>Solution Exp -> VC++ Directories ->Include Directories -> C:\Program Files\MPICH2\include;$(IncludePath)</p>
  
  <p>Solution Exp -> VC++ Directories ->Library Directories -> C:\Program C:\Program Files\MPICH2\lib;$(LibraryPath)</p>
  
  <p>Solution Exp -> Linker -> General -> Additional Library Directories -> C:\Program Files\MPICH2\lib;%(AdditionalLibraryDirectories)</p>
  
  <p>Solution Exp -> Linker -> Input -> AdditionalDipendencies -> cxx.lib;mpi.lib;%(AdditionalDependencies)</p>