This is the mail archive of the pthreads-win32@sources.redhat.com mailing list for the pthreas-win32 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problem linking with pthreadVC2.lib (newbie)


You need to define PTW32_STATIC_LIB for your application build (I think
this is in the (rather too long) README file). It's used by pthread.h to
switch off the import/export dll declspec stuff. The reason for the
explicit define is that some people want to statically link pthreads-
win32 into their own dll build, and so using the predefined _DLL
conflicts.

Regards.
Ross

On Thu, 2005-04-21 at 05:28 -0700, Rajiv Kumar wrote:
> I have built the static pthread library: nmake VC-static
> I have a test program(test.c) with only two lines of code  in main():
> 	pthread_mutex_t mutex = NULL;
> 	pthread_mutex_lock(&mutex);
> I include pthread.h in the test program and link with pthreadVC2.lib
> I get the following link error :
> error LNK2019: unresolved external symbol __imp__pthread_mutex_lock
> referenced in function _main
> fatal error LNK1120: 1 unresolved externals
> Im using MSVC 7.1 on win2k.
> Please advise to resolve this.
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]