Boost logo

Boost Users :

Subject: Re: [Boost-users] cross-compilation x86_64-w64-ming32: undefined reference to `InterlockedIncrement'
From: Vitaly Budovski (vbudovski+news_at_[hidden])
Date: 2013-09-08 01:11:02


On 8 September 2013 06:21, Frédéric Bron <frederic.bron_at_[hidden]> wrote:

>
> mgw64-release/obj/Tests/xuxu2.o:xuxu2.cc:(.text$_ZN5boost6threadD1Ev[_ZN5boost6threadD1Ev]+0x1a):
> undefined reference to `InterlockedDecrement'
> mgw64-release/obj/Tests/xuxu2.o:xuxu2.cc:(.text.startup+0xf6):
> undefined reference to `InterlockedIncrement'
>
> /usr/lib64/gcc/x86_64-w64-mingw32/4.8.1/../../../../x86_64-w64-mingw32/bin/ld:
> mgw64-release/obj/Tests/xuxu2.o: bad reloc address 0xf6 in section
> `.text.startup'
> collect2: error: ld returned 1 exit status
>
> I have also made a minimal example so that anybody can test:
> #include <iostream>
> #include <boost/thread.hpp>
> struct Runner {
> void operator()() const {
> std::cout<<"Runner::operator()\n"; }
> };
> int main(int, char*[]) {
> Runner r;
> boost::thread t1(r);
> t1.join();
> return 0;
> }
>
> Cheers,
>
> Frédéric
>

Hi,

It looks like boost needs to handle the mingw case differently. See this
thread and the patch within it.
http://sourceforge.net/mailarchive/message.php?msg_id=31189847

I haven't had time to test whether it resolves the issue, but try it out
and let us know.

Cheers,

Vitaly



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net