I am having trouble linking my application statically on a x64 platform...(there is no problem linking the application
with the dll version).. Additional details on the errors are attached below.
Any help is much appreciated.
Compiler: VS 2008 9.0
System: Windows XP SP2 on x64
xxx.obj : error LNK2019: unresolved external symbol pthread_mutex_init referenced in function ....
xxx.obj : error LNK2019: unresolved external symbol pthread_mutex_destroy referenced in function ....
xxx.obj : error LNK2019: unresolved external symbol pthread_mutex_lock referenced in function ....
xxx.obj : error LNK2019: unresolved external symbol pthread_mutex_unlock referenced in function ....
Steps I followed:
1. I compiled a static version of the pthreads_win32 lib with no errors
nmake clean VC-static
2. Added PTW32_STATIC_LIB to preprocessor flags for application
Added path to static lib in Linker->General->Additional Library Directories
Added pthreadVC2.lib in Linker->Input->Additional Dependencies
3. Looked at symbols in pthreadVC2.lib searching (for example) for pthread_mutex_init
--- For comparison, in the dynamically built pthreadVC32.lib, the symbols are slightly different:
Symbol name : pthread_mutex_init
Name : pthread_mutex_init