public inbox for pthreads-win32@sourceware.org
 help / color / mirror / Atom feed
* Unresolved external symbol __imp_pthread_mutex_unlock
@ 2018-11-08 21:54 Josh Henrie
  2018-11-08 22:15 ` Josh Henrie
  2018-11-09  8:20 ` John Emmas
  0 siblings, 2 replies; 3+ messages in thread
From: Josh Henrie @ 2018-11-08 21:54 UTC (permalink / raw)
  To: pthreads-win32

I have compiled pthreads-win32 as a static library using VS 2008 with the
following preprocessor definitions:
    _DEBUG
    _WIN32_WCE=0x600
    UNDER_CE
    WINCE
    DEBUG
    _LIB
    ARM
    _ARM_
    _UNICODE
    UNICODE
    HAVE_CONFIG_H
    NEED_PROCESS_AFFINITY_MASK
    NEED_ERRNO
    __PTW32_RC_MSC
    __PTW32_ARCHARM
    __PTW32_STATIC_LIB


However, when I try to link it with my project I get the following linker
errors:
    error LNK2001: unresolved external symbol __imp_pthread_mutex_unlock
    error LNK2001: unresolved external symbol __imp_pthread_mutex_lock
    error LNK2001: unresolved external symbol __imp_pthread_self
    error LNK2001: unresolved external symbol __imp_pthread_cond_signal
    error LNK2001: unresolved external symbol __imp_pthread_join
    error LNK2001: unresolved external symbol __imp_pthread_create
    error LNK2001: unresolved external symbol __imp_pthread_equal
    error LNK2019: unresolved external symbol __imp_pthread_cond_timedwait
    error LNK2019: unresolved external symbol __imp_pthread_cond_broadcast

When I use `dumpbin /symbols` on the static library I see the following
symbols:
    4BE 00005CC0 SECT8  notype ()    External     | pthread_mutex_unlock
    44D 000050B4 SECT8  notype ()    External     | pthread_mutex_lock
    399 00004428 SECT8  notype ()    External     | pthread_self
    2E6 0000359C SECT8  notype ()    External     | pthread_cond_signal
    83D 0000A110 SECT8  notype ()    External     | pthread_join
    332 00003D50 SECT8  notype ()    External     | pthread_create
    377 0000423C SECT8  notype ()    External     | pthread_equal
    32B 00003D00 SECT8  notype ()    External     | pthread_cond_timedwait
    302 000038C0 SECT8  notype ()    External     | pthread_cond_broadcast


Why is the linker trying to resolve the functions with the prefix `__imp_`?
What do I need to do to resolve the symbols?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Unresolved external symbol __imp_pthread_mutex_unlock
  2018-11-08 21:54 Unresolved external symbol __imp_pthread_mutex_unlock Josh Henrie
@ 2018-11-08 22:15 ` Josh Henrie
  2018-11-09  8:20 ` John Emmas
  1 sibling, 0 replies; 3+ messages in thread
From: Josh Henrie @ 2018-11-08 22:15 UTC (permalink / raw)
  To: pthreads-win32

I should also state that I do have the full name and path of my
pthreads-win32 static library as an additional linker dependency within my
project.

https://sourceware.org/ml/pthreads-win32/2013/msg00015.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Unresolved external symbol __imp_pthread_mutex_unlock
  2018-11-08 21:54 Unresolved external symbol __imp_pthread_mutex_unlock Josh Henrie
  2018-11-08 22:15 ` Josh Henrie
@ 2018-11-09  8:20 ` John Emmas
  1 sibling, 0 replies; 3+ messages in thread
From: John Emmas @ 2018-11-09  8:20 UTC (permalink / raw)
  To: pthreads-win32

On 08/11/2018 21:53, Josh Henrie wrote:
> Why is the linker trying to resolve the functions with the prefix `__imp_`?
> What do I need to do to resolve the symbols?
>

The prefix '__imp_' signifies that your main project (i.e. not the 
pthreads_win32 project) is expecting to import those symbols from a DLL 
(but it found a static link lib, rather than the DLL link lib that it 
was expecting).  Basically, there's a mismatch between your main project 
and pthreads_win32.  Most likely, your main project also needs to 
#define PTW32_STATIC_LIB (so that BOTH projects expect a static lib).  
Hope that helps,

John

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-11-09  8:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-08 21:54 Unresolved external symbol __imp_pthread_mutex_unlock Josh Henrie
2018-11-08 22:15 ` Josh Henrie
2018-11-09  8:20 ` John Emmas

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).