Boost C++ Libraries: Ticket #5921: MingW Boost linking https://svn.boost.org/trac10/ticket/5921 <p> Dear all, </p> <p> I am trying to link boost thread 1.47 using Mingw version 4.6.1. I already applied the modification proposed in <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4614" title="#4614: Bugs: Unable to statically link thread lib on mingw/win32 (closed: fixed)">#4614</a>; that is I added the or condition for defined(MINGW32) on line 40 of the file config.hpp. The other suggestion in <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4258" title="#4258: Bugs: Linking with boost thread does not work on mingw/gcc 4.5 (closed: fixed)">#4258</a> cannot be applied due to the fact that the file tss_pe.cpp seems not to exist anymore. After the modification I recompiled all the library using gcc as --toolset option. </p> <p> In particular I get the following linking-time errors. </p> <p> Surface.o:Surface.cpp:(.text+0x1833): undefined reference to `boost::thread::~thread()' Surface.o:Surface.cpp:(.text+0x1d07): undefined reference to `boost::thread::hardware_concurrency()' Surface.o:Surface.cpp:(.text+0x20f4): undefined reference to `boost::thread::start_thread()' Surface.o:Surface.cpp:(.text+0x23a2): undefined reference to `boost::thread::start_thread()' Surface.o:Surface.cpp:(.text+0x250b): undefined reference to `boost::thread::join()' Surface.o:Surface.cpp:(.text+0x26fb): undefined reference to `boost::thread::~thread()' Surface.o:Surface.cpp:(.text+0x34b8): undefined reference to `boost::thread::~thread()' Surface.o:Surface.cpp:(.text+0x35c3): undefined reference to `boost::thread::~thread()' </p> <p> If I use the unmodified boost library I get the same errors. Additionally I already recompiled bjam and I both used b2 and the recompiled bjam with no success. In any case the boost library is succesfully built and I get linking errors only when linking from my sources. The same sources and makefile work well on Linux; they work also in Window using Visual Studio and boost threads again in version 1.47. </p> <p> Any suggestion? Thanks </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5921 Trac 1.4.3 anonymous Tue, 08 Nov 2011 15:55:20 GMT <link>https://svn.boost.org/trac10/ticket/5921#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5921#comment:1</guid> <description> <p> It seems you need to link with the thread library. Could you post the exact command line the made these errors? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Mon, 12 Dec 2011 22:45:25 GMT</pubDate> <title>status, component changed; resolution set https://svn.boost.org/trac10/ticket/5921#comment:2 https://svn.boost.org/trac10/ticket/5921#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">thread</span> </li> </ul> Ticket