From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18633 invoked by alias); 19 Jul 2013 00:30:36 -0000 Mailing-List: contact pthreads-win32-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: pthreads-win32-owner@sourceware.org Received: (qmail 18624 invoked by uid 89); 19 Jul 2013 00:30:36 -0000 X-Spam-SWARE-Status: No, score=0.1 required=5.0 tests=BAYES_50,FREEMAIL_FROM,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_YE,RDNS_NONE autolearn=no version=3.3.1 Received: from Unknown (HELO nm11-vm1.bullet.mail.bf1.yahoo.com) (98.139.213.152) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 19 Jul 2013 00:30:35 +0000 Received: from [66.196.81.172] by nm11.bullet.mail.bf1.yahoo.com with NNFMP; 19 Jul 2013 00:30:27 -0000 Received: from [98.139.212.241] by tm18.bullet.mail.bf1.yahoo.com with NNFMP; 19 Jul 2013 00:30:27 -0000 Received: from [127.0.0.1] by omp1050.mail.bf1.yahoo.com with NNFMP; 19 Jul 2013 00:30:27 -0000 Received: (qmail 66864 invoked by uid 60001); 19 Jul 2013 00:30:27 -0000 Received: from [174.114.7.10] by web162204.mail.bf1.yahoo.com via HTTP; Thu, 18 Jul 2013 17:30:24 PDT References: <1374179109.59111.YahooMailNeo@web162205.mail.bf1.yahoo.com> Message-ID: <1374193824.66747.YahooMailNeo@web162204.mail.bf1.yahoo.com> Date: Fri, 19 Jul 2013 00:30:00 -0000 From: S R Reply-To: S R Subject: Error linking static library (x64) in VS2008 To: "pthreads-win32@sourceware.org" In-Reply-To: <1374179109.59111.YahooMailNeo@web162205.mail.bf1.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2013/txt/msg00015.txt.bz2 I am having trouble linking my application statically on a x64 platform...(= there is no problem linking the application with the dll version)..=A0 Additional details on the errors are attached be= low. Any help is much appreciated. Thanks=20 Sriram Compiler: VS 2008 9.0 System: Windows XP SP2 on x64 Errors: xxx.obj : error LNK2019: unresolved external symbol pthread_mutex_init refe= renced in function .... xxx.obj : error LNK2019: unresolved external symbol pthread_mutex_destroy r= eferenced in function .... xxx.obj : error LNK2019: unresolved external symbol pthread_mutex_lock refe= renced in function .... xxx.obj : error LNK2019: unresolved external symbol pthread_mutex_unlock re= ferenced in function .... Steps I followed: 1. I compiled a static version of the pthreads_win32 lib with no errors =A0=A0=A0 nmake clean VC-static 2. Added PTW32_STATIC_LIB to preprocessor flags for application =A0=A0 Added path to static lib in=A0 Linker->General->Additional Library D= irectories =A0=A0 Added pthreadVC2.lib in Linker->Input->Additional Dependencies 3. Looked at symbols in pthreadVC2.lib searching (for example) for pthread_= mutex_init =A0=A0=A0 =A0=A0 2BFA _pthread_mutex_init =A0=A0=A0=A0=A0=A0=A0 2 _pthread_mutex_init =A0=A0=A0=A0=A0=A0=A0=A0 COMDAT; sym=3D _pthread_mutex_init =A000000000=A0 DIR32NB=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0 00000000=A0=A0=A0=A0=A0=A0=A0 F4=A0 _pthread_mutex_init =A0000000A2=A0 REL32=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0 00000000=A0=A0=A0=A0=A0=A0=A0 F4=A0 _pthread_mutex_init =A00000008C=A0 REL32=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0 00000000=A0=A0=A0=A0=A0=A0=A0 F4=A0 _pthread_mutex_init =A0000000A3=A0 REL32=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0 00000000=A0=A0=A0=A0=A0=A0=A0 F4=A0 _pthread_mutex_init =A000000068=A0 REL32=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0 00000000=A0=A0=A0=A0=A0=A0=A0 F4=A0 _pthread_mutex_init =A0000000B0=A0 REL32=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0 00000000=A0=A0=A0=A0=A0=A0=A0 F4=A0 _pthread_mutex_init =A0000000B6=A0 REL32=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0 00000000=A0=A0=A0=A0=A0=A0=A0 F4=A0 _pthread_mutex_init 0F4 00000000 SECT51 notype ()=A0=A0=A0 External=A0=A0=A0=A0 | _pthread_mute= x_init --- For comparison, in the dynamically built pthreadVC32.lib, the symbols a= re slightly different: =A0=A0=A0=A0 5578 __imp_pthread_mutex_init =A0=A0=A0=A0 5578 pthread_mutex_init =A0=A0=A0=A0=A0=A0 1B __imp_pthread_mutex_init =A0=A0=A0=A0=A0=A0 1B pthread_mutex_init =A0 Symbol name=A0 : pthread_mutex_init =A0 Name=A0=A0=A0=A0=A0=A0=A0=A0 : pthread_mutex_init =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 pthread_mutex_init --- In file xxx.obj, the references appear as follows: =A0=A0=A0 61934 _pthread_mutex_init =A0=A0=A0=A0=A0=A0=A0 1 _pthread_mutex_init =A0=A0=A0=A0=A0=A0=A0=A0 COMDAT; sym=3D _pthread_mutex_init =A000000000=A0 DIR32NB=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0 00000000=A0=A0=A0=A0=A0=A0=A0 F4=A0 _pthread_mutex_init =A0000000A2=A0 REL32=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0 00000000=A0=A0=A0=A0=A0=A0=A0 F4=A0 _pthread_mutex_init =A00000008C=A0 REL32=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0 00000000=A0=A0=A0=A0=A0=A0=A0 F4=A0 _pthread_mutex_init =A0000000A3=A0 REL32=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0 00000000=A0=A0=A0=A0=A0=A0=A0 F4=A0 _pthread_mutex_init =A000000068=A0 REL32=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0 00000000=A0=A0=A0=A0=A0=A0=A0 F4=A0 _pthread_mutex_init =A0000000B0=A0 REL32=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0 00000000=A0=A0=A0=A0=A0=A0=A0 F4=A0 _pthread_mutex_init =A0000000B6=A0 REL32=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0 00000000=A0=A0=A0=A0=A0=A0=A0 F4=A0 _pthread_mutex_init 0F4 00000000 SECT51 notype ()=A0=A0=A0 External=A0=A0=A0=A0 | _pthread_mute= x_init =A00000000C=A0 REL32=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0 00000000=A0=A0=A0=A0=A0=A0 4AC=A0 pthread_mutex_init =A00000000E=A0 REL32=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0 00000000=A0=A0=A0=A0=A0=A0 4AC=A0 pthread_mutex_init 4AC 00000000 UNDEF=A0 notype ()=A0=A0=A0 External=A0=A0=A0=A0 | pthread_mut= ex_init