public inbox for pthreads-win32@sourceware.org
 help / color / mirror / Atom feed
From: S R <sriram_ott@yahoo.com>
To: "pthreads-win32@sourceware.org" <pthreads-win32@sourceware.org>
Subject: Error linking static library (x64) in VS2008
Date: Fri, 19 Jul 2013 00:30:00 -0000	[thread overview]
Message-ID: <1374193824.66747.YahooMailNeo@web162204.mail.bf1.yahoo.com> (raw)
In-Reply-To: <1374179109.59111.YahooMailNeo@web162205.mail.bf1.yahoo.com>



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.

Thanks 
Sriram

Compiler: VS 2008 9.0


System: Windows XP SP2 on x64


Errors:

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

       2BFA _pthread_mutex_init
        2 _pthread_mutex_init
         COMDAT; sym= _pthread_mutex_init
 00000000  DIR32NB                    00000000        F4  _pthread_mutex_init
 000000A2  REL32                     
00000000        F4  _pthread_mutex_init
 0000008C  REL32                      00000000        F4  _pthread_mutex_init
 000000A3  REL32                      00000000        F4  _pthread_mutex_init
 00000068  REL32                      00000000        F4  _pthread_mutex_init
 000000B0  REL32                     
00000000        F4  _pthread_mutex_init
 000000B6  REL32                      00000000        F4  _pthread_mutex_init
0F4 00000000 SECT51 notype ()    External     | _pthread_mutex_init

--- For comparison, in the dynamically built pthreadVC32.lib, the symbols are slightly different:
     5578 __imp_pthread_mutex_init
     5578 pthread_mutex_init
       1B __imp_pthread_mutex_init
       1B pthread_mutex_init
  Symbol name  : pthread_mutex_init
  Name         : pthread_mutex_init
                  pthread_mutex_init

--- In file xxx.obj, the references appear as follows:
    61934 _pthread_mutex_init
        1 _pthread_mutex_init
         COMDAT; sym= _pthread_mutex_init
 00000000  DIR32NB                    00000000        F4  _pthread_mutex_init
 000000A2  REL32                      00000000        F4  _pthread_mutex_init
 0000008C  REL32                      00000000        F4  _pthread_mutex_init
 000000A3  REL32                      00000000        F4  _pthread_mutex_init
 00000068  REL32                      00000000        F4  _pthread_mutex_init
 000000B0  REL32                      00000000        F4  _pthread_mutex_init
 000000B6  REL32                      00000000        F4  _pthread_mutex_init
0F4 00000000 SECT51 notype ()    External     | _pthread_mutex_init
 0000000C  REL32                      00000000       4AC  pthread_mutex_init
 0000000E  REL32                      00000000       4AC  pthread_mutex_init
4AC 00000000 UNDEF  notype ()    External     | pthread_mutex_init

           reply	other threads:[~2013-07-19  0:30 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <1374179109.59111.YahooMailNeo@web162205.mail.bf1.yahoo.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1374193824.66747.YahooMailNeo@web162204.mail.bf1.yahoo.com \
    --to=sriram_ott@yahoo.com \
    --cc=pthreads-win32@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).