From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8890 invoked by alias); 22 Apr 2005 04:07:50 -0000 Mailing-List: contact pthreads-win32-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: pthreads-win32-owner@sources.redhat.com Received: (qmail 6270 invoked from network); 22 Apr 2005 04:05:38 -0000 Received: from unknown (HELO canyonero.dot.net.au) (202.147.68.14) by sourceware.org with SMTP; 22 Apr 2005 04:05:38 -0000 Received: from [203.129.40.19] (helo=ppp-40-19.grapevine.net.au) by canyonero.dot.net.au with esmtp (Exim 3.35 #1 (Debian)) id 1DOpQ9-0007Pv-00 for ; Fri, 22 Apr 2005 14:05:37 +1000 Subject: Re: Problem linking with pthreadVC2.lib (newbie) From: Ross Johnson To: Pthreads-Win32 list In-Reply-To: References: Content-Type: text/plain Date: Fri, 22 Apr 2005 04:07:00 -0000 Message-Id: <1114142735.14400.12.camel@desk.home> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-SW-Source: 2005/txt/msg00076.txt.bz2 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. >