Using Boost 1.44 with the latest Mingw
Writing a simple thread program with boost which I can link just fine to the .dll . Tried running, it no problem.
I tried statically linking to the library. Changed the library to the static version. Defined #define BOOST_THREAD_USE_LIB .
So here is the problem: no errors are reported during the building process but the executable fails to build.
Here's the build log :
Linking console executable: bin\Debug\PassTheBit.exe
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.5.0/../../../libmingw32.a(tlssup.o):tlssup.c:(.tls+0x0): multiple definition of `_tls_used'
..\..\..\boost_1_44_0\stage\lib\libboost_thread-mgw45-mt-s-1_44.a(tss_pe.o):tss_pe.cpp:(.rdata$T+0x0): first defined here
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.5.0/../../../../mingw32/bin/ld.exe: warning: auto-importing has been activated without --enable-auto-import specified on the command line.
This should work unless it involves constant data structures referencing symbols from auto-imported DLLs.
collect2: ld returned 1 exit status
Info: resolving vtable for std::exception by linking to __imp___ZTVSt9exception (auto-import)
Info: resolving vtable for std::bad_alloc by linking to __imp___ZTVSt9bad_alloc (auto-import)
Info: resolving std::cout by linking to __imp___ZSt4cout (auto-import)
Info: resolving std::cin by linking to __imp___ZSt3cin (auto-import)
Info: resolving vtable for __cxxabiv1::__si_class_type_info by linking to __imp___ZTVN10__cxxabiv120__si_class_type_infoE (auto-import)
Info: resolving vtable for __cxxabiv1::__vmi_class_type_info by linking to __imp___ZTVN10__cxxabiv121__vmi_class_type_infoE (auto-import)
Info: resolving vtable for __cxxabiv1::__class_type_info by linking to __imp___ZTVN10__cxxabiv117__class_type_infoE (auto-import)
Info: resolving vtable for __cxxabiv1::__pointer_type_info by linking to __imp___ZTVN10__cxxabiv119__pointer_type_infoE (auto-import)
Info: resolving vtable for std::runtime_error by linking to __imp___ZTVSt13runtime_error (auto-import)
Info: resolving vtable for std::logic_error by linking to __imp___ZTVSt11logic_error (auto-import)
Info: resolving std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage by linking to __imp___ZNSs4_Rep20_S_empty_rep_storageE (auto-import)
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 1 warnings
Any suggestions ?