It looks to me that you are trying to use a copy of pthreads compiled with the GNU compiler. While this is possible you are required to link.
There is a copy of the pthreads source which can be compiled with the Visual Studio compiler at
http://sourceware.org/pthreads-win32/[
^]. I used it recently with Visual Studio 2008.
This will also help with debugging, as the debugger will be able to show you exactly what is going wrong with your code.