I'm trying to use pthreads and am getting undefined references. Here's the command line
Code:
C:/Bin/Mingw/bin/../libexec/gcc/mingw32/3.4.2/collect2.exe -Bdynamic -o Stktest.exe
C:/Bin/Mingw/bin/../lib/gcc/mingw32/3.4.2/../../../crt2.o
C:/Bin/Mingw/bin/../lib/gcc/mingw32/3.4.2/crtbegin.o
-LC:\Bin\Stk\bin -LC:\Bin\Mingw\Lib -LC:\Bin\Pthreads\lib
-LC:/Bin/Mingw/bin/../lib/gcc/mingw32/3.4.2
-LC:/Bin/Mingw/bin/../lib/gcc
-LC:/Bin/Mingw/bin/../lib/gcc/mingw32/3.4.2/../../../../mingw32/lib
-LC:/Bin/Mingw/bin/../lib/gcc/mingw32/3.4.2/../../..
Debug\stdafx.o Debug\Stktest.o
-lpthreadGC2 -lstk -lstdc++ -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt
-luser32 -lkernel32 -ladvapi32 -lshell32 -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt
C:/Bin/Mingw/bin/../lib/gcc/mingw32/3.4.2/crtend.o
C:\Bin\Stk\bin/libstk.a(RtAudio.o): In function `ZN5RtApiD0Ev':C:/Bin/Stk/src/RtAudio.cpp:263: undefined reference to `_imp__pthread_mutex_destroy'
C:\Bin\Stk\bin/libstk.a(RtAudio.o): In function `ZN5RtApiD1Ev':C:/Bin/Stk/src/RtAudio.cpp:263: undefined reference to `_imp__pthread_mutex_destroy'
C:\Bin\Stk\bin/libstk.a(RtAudio.o): In function `ZN5RtApiD2Ev':C:/Bin/Stk/src/RtAudio.cpp:263: undefined reference to `_imp__pthread_mutex_destroy'
C:\Bin\Stk\bin/libstk.a(RtAudio.o): In function `ZN5RtApiC1Ev':C:/Bin/Stk/src/RtAudio.cpp:258: undefined reference to `_imp__pthread_mutex_init'
C:\Bin\Stk\bin/libstk.a(RtAudio.o): In function `ZN5RtApiC2Ev':C:/Bin/Stk/src/RtAudio.cpp:258: undefined reference to `_imp__pthread_mutex_init'
Here's the dumpbin of the pthreads library I'm linking against
Code:
C:\Bin\Pthreads\lib>dumpbin libpthreadGC2.a /exports
Microsoft (R) COFF/PE Dumper Version 8.00.50727.762
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file libpthreadGC2.a
File Type: LIBRARY
Exports
ordinal name
_sem_wait
_sem_unlink
_sem_trywait
_sem_timedwait
_sem_post_multiple
...
_pthread_mutexattr_destroy
_pthread_mutex_unlock
_pthread_mutex_trylock
_pthread_mutex_timedlock
_pthread_mutex_lock
_pthread_mutex_init
_pthread_mutex_destroy
...
Summary
0 .bss
0 .data
14 .idata$2
1D4 .idata$4
1D4 .idata$5
B10 .idata$6
1DC .idata$7
398 .text
C:\Bin\Pthreads\lib>
A similar thread I found was here: http://sourceware.org/ml/pthreads-wi.../msg00056.html
Answer here: http://sourceware.org/ml/pthreads-wi.../msg00058.html
But the case of link order doesn't seem to be the issue, but my dumpbin doesn't contain these '_imp_xxx' references, so I'm not exactly sure what to do