Opened 11 years ago

Closed 11 years ago

#5921 closed Support Requests (fixed)

MingW Boost linking

Reported by: sergio.d Owned by:
Milestone: To Be Determined Component: thread
Version: Boost 1.47.0 Severity: Problem
Keywords: Cc:

Description

Dear all,

I am trying to link boost thread 1.47 using Mingw version 4.6.1. I already applied the modification proposed in #4614; that is I added the or condition for defined(MINGW32) on line 40 of the file config.hpp. The other suggestion in #4258 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.

In particular I get the following linking-time errors.

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()'

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.

Any suggestion? Thanks

Change History (2)

comment:1 by anonymous, 11 years ago

It seems you need to link with the thread library. Could you post the exact command line the made these errors?

comment:2 by viboes, 11 years ago

Component: Nonethread
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.