title: How to add pthread library to C++ project in Visual Studio Community Edition?
body: <p>I wanted to be able to use pthreads in visual studio because I was using it to debug, and was following the tutorial here. </p>
  
  <p><a href="http://web.cs.du.edu/~sturtevant/pthread.html" rel="nofollow">http://web.cs.du.edu/~sturtevant/pthread.html</a></p>
  
  <p>It seems simple enough, add the .h files to the C++ include directory and add the .lib file to the lib directory.</p>
  
  <p>However, while the .h files are being detected, I am getting an error:</p>
  
  <pre><code>Error   1   error LNK2019: unresolved external symbol __imp__pthread_create 
  </code></pre>
  
  <p>I take this to mean that the .lib file is not being detected properly.</p>
  
  <p>I thought I could just add the .lib file to the lib listing at 
  Project Properties -> Linker -> Additional Dependencies
  using its full path like so:</p>
  
  <pre><code>D:\Visual Studio\VC\lib\pthreadVC2.lib;kernel32.lib;user32.lib;
  </code></pre>
  
  <p>Not sure if there is any advantage to appending the new lib to the beginning of the list or the end of the list, but neither seems to work.</p>
  
  <p>In the command line tab, we can see the command that is actually run (I think):</p>
  
  <pre><code>/OUT:"C:\projects\GTKWavePipe\NamedPipeTest\Debug\NamedPipeTest.exe" /MANIFEST /NXCOMPAT /PDB:"C:\projects\GTKWavePipe\NamedPipeTest\Debug\NamedPipeTest.pdb" /DYNAMICBASE "D:\Visual Studio\VC\lib\pthreadVC2.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" /DEBUG /MACHINE:X86 /INCREMENTAL /PGD:"C:\projects\GTKWavePipe\NamedPipeTest\Debug\NamedPipeTest.pgd" /SUBSYSTEM:CONSOLE /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /ManifestFile:"Debug\NamedPipeTest.exe.intermediate.manifest" /ERRORREPORT:PROMPT /NOLOGO /TLBID:1 
  </code></pre>
  
  <p>Does anyone know what I might be doing wrong? Ultimately I can always just go do my debugging in my cygwin environment, but the debugger I'm using there is not as good.</p>
  
  <p>Plus, I think being able to add libraries into visual studio seems like a useful skill.</p>