Ok, a question with a different flavor.
I have to port to windows a simple program that used pthreads. For this purpose, I think this is ideal. I followed the instructions found on faq (mainly question 8) but I have a problem on the linking process. I am using Visual C++ 2005 Express Edition (now available 2008). I downloaded the pthreads-w32-2-8-0-release.tar.gz (found near the end here). I placed the prebuilt pthreadVC2.dll under my C:\WINDOWS directory, and the three header files under C:\Program Files\Microsoft Visual Studio 8\VC\include which is the only directory in my INCLUDE variable. Similarly, I placed pthreadVC2.lib file under the directory C:\Program Files\Microsoft Visual Studio 8\VC\lib. Moreover, under
Code:
Tools->Options ...->Projects and Solutions->VC++ Directories
I also inserted the directory where the header files and the .lib file could be found in the unzipped directory of what I initially downloaded. Yet, although this thing compiles, it doesn't link:
Code:
1>------ Build started: Project: MCthreads, Configuration: Debug Win32 ------
1>Compiling...
1>math_toolbox.cpp
1>MonteCarlo.cpp
1>queue.cpp
1>Generating Code...
1>Compiling manifest to resources...
1>Linking...
1>mc.obj : error LNK2019: unresolved external symbol __imp__pthread_join referenced in function _main
1>mc.obj : error LNK2019: unresolved external symbol __imp__pthread_mutex_unlock referenced in function _main
1>mc.obj : error LNK2019: unresolved external symbol __imp__pthread_cond_signal referenced in function _main
1>mc.obj : error LNK2019: unresolved external symbol __imp__pthread_mutex_lock referenced in function _main
1>mc.obj : error LNK2019: unresolved external symbol __imp__pthread_create referenced in function _main
1>mc.obj : error LNK2019: unresolved external symbol __imp__pthread_cond_init referenced in function _main
1>mc.obj : error LNK2019: unresolved external symbol __imp__pthread_mutex_init referenced in function _main
1>mc.obj : error LNK2019: unresolved external symbol __imp__pthread_attr_setdetachstate referenced in function _main
1>mc.obj : error LNK2019: unresolved external symbol __imp__pthread_attr_init referenced in function _main
1>mc.obj : error LNK2019: unresolved external symbol __imp__pthread_exit referenced in function "void * __cdecl worker_function(void *)" (?worker_function@@YAPAXPAX@Z)
1>mc.obj : error LNK2019: unresolved external symbol __imp__pthread_cond_wait referenced in function "void * __cdecl worker_function(void *)" (?worker_function@@YAPAXPAX@Z)
1>Debug\MCthreads.exe : fatal error LNK1120: 11 unresolved externals
1>Build log was saved at "file://c:\Documents and Settings\dimis\Desktop\MCthreads\Debug\BuildLog.htm"
1>MCthreads - 12 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Any suggestions on what might went wrong?