[thread] 1.47 on cygwin 1.7 -> undefined reference to boost::detail::set_tss_data::shared_ptr::tss_cleanup

I am trying to use boost 1.47 on cygwin 1.7 cross-compiling to win32
with i686-w64-mingw32-g++ (4.5.3).
This program gives me an error:
#include

2011/8/17 Frédéric Bron
I am trying to use boost 1.47 on cygwin 1.7 cross-compiling to win32 with i686-w64-mingw32-g++ (4.5.3).
This program gives me an error:
#include
int main() { boost::thread_specific_ptr<int> ts; return 0; } $ i686-w64-mingw32-g++ -o mgw-release/obj/Tests/toto.o -c -O3 -DNDEBUG -Wall -Wextra -pipe -mthreads -I/cygdrive/d/Softs/1.7/mgw-release/boost/include -I. Tests/toto.cc In file included from
/cygdrive/d/Softs/1.7/mgw-release/boost/include/boost/thread/detail/thread_heap_alloc.hpp:15:0, from /cygdrive/d/Softs/1.7/mgw-release/boost/include/boost/thread/tss.hpp:10, from Tests/toto.cc:1:
/cygdrive/d/Softs/1.7/mgw-release/boost/include/boost/thread/win32/thread_heap_alloc.hpp:59:40: warning: inline function ‘void* boost::detail::allocate_raw_heap_memory(unsigned int)’ declared as dllimport: attribute ignored
/cygdrive/d/Softs/1.7/mgw-release/boost/include/boost/thread/win32/thread_heap_alloc.hpp:69:39: warning: inline function ‘void boost::detail::free_raw_heap_memory(void*)’ declared as dllimport: attribute ignored
$ i686-w64-mingw32-g++ -o mgw-release/bin/toto -O3 -DNDEBUG -Wall -Wextra -pipe -mthreads -I/cygdrive/d/Softs/1.7/mgw-release/boost/include mgw-release/obj/Tests/toto.o -Wl,--enable-auto-import -static -L/cygdrive/d/Softs/1.7/mgw-release/boost/lib -lboost_thread_win32 mgw-release/obj/Tests/toto.o:toto.cc:(.text+0x104): undefined reference to `__imp___ZN5boost6detail12set_tss_dataEPKvNS_10shared_ptrINS0_20tss_cleanup_functionEEEPvb' collect2: ld returned 1 exit status
any help would be welcome.
Try to compile with -DBOOST_THREAD_USE_LIB=1

Try to compile with -DBOOST_THREAD_USE_LIB=1
I now get the following error: /usr/i686-w64-mingw32/sys-root/mingw/lib/libmingw32.a(lib32_libmingw32_a-tlssup.o):tlssup.c:(.tls+0x0): multiple definition of `__tls_used' /cygdrive/d/Softs/1.7/mgw-release/boost/lib/libboost_thread_win32.a(tss_pe.o):tss_pe.cpp:(.rdata$T+0x0): first defined here Frédéric

On 1:59 PM, TONGARI wrote:
2011/8/17 Frédéric Bron
mailto:frederic.bron@m4x.org> I am trying to use boost 1.47 on cygwin 1.7 cross-compiling to win32 with i686-w64-mingw32-g++ (4.5.3).
This program gives me an error:
#include
int main() { boost::thread_specific_ptr<int> ts; return 0; } ...: undefined reference to `__imp___ZN5boost6detail12set_tss_dataEPKvNS_10shared_ptrINS0_20tss_cleanup_functionEEEPvb' collect2: ld returned 1 exit status
any help would be welcome.
Try to compile with -DBOOST_THREAD_USE_LIB=1

Happy to see that I am not the only one in the dark. Did you learn more about it in the end? Frédéric

On 1:59 PM, Frédéric Bron wrote:
Seehttps://svn.boost.org/trac/boost/ticket/4921 Happy to see that I am not the only one in the dark. Did you learn more about it in the end? Frédéric
Just that I need those flags and many others don't (e.g., Linux users). Some other libs (e.g., serialization) have similar ones.
participants (3)
-
Frédéric Bron
-
Jim Bell
-
TONGARI