I want to pthread lib statically linked with my application so that at other target without install pthread lib my .exe will run.
For that I have add pthreadVC.lib in Linker->input->additional dependency of visual studio and also given correct path for lib.
Also I add this code #define PTW32_STATIC_LIB
in my thread.h file before #include <pthread.h>
My application build successfully and running on same machine. But I trying to run on other target I got error pthreadVC.dll is missing .
Please tell me where I am missing.
In my case i was not having static lib and i was trying to do static link with dynamic lib. Following are steps to do static linking .
Linker->input->additional dependency
and addpthread_lib.lib
.pthread_lib.lib
into visual studio propertiesLinker->General->Additional Library Directories
.#define PTW32_STATIC_LIB
in header file.