Boost logo

Boost :

Subject: Re: [boost] [Boost-users] cross-compilation x86_64-w64-ming32: undefined reference to `InterlockedIncrement'
From: Frédéric Bron (frederic.bron_at_[hidden])
Date: 2013-09-23 08:38:56


> Does it help if you just replace:
>
> #if defined(__MINGW64__)
> #define BOOST_INTERLOCKED_IMPORT
> #else
> #define BOOST_INTERLOCKED_IMPORT __declspec(dllimport)
> #endif
>
> with
>
> #define BOOST_INTERLOCKED_IMPORT BOOST_SYMBOL_IMPORT
>
> and no other changes? If that fixes the problem, this would be a more
> appropriate solution for 1.55. In the long term it might be worthwhile to
> use gcc atomic intrinsics to implement BOOST_INTERLOCKED* macros.

target i686 is OK but target x86_64 gives this error:

xuxu-x86_64-w64-mingw32-g++-4.8.1.o:xuxu.cc:(.text+0x1b7): undefined
reference to `__imp_InterlockedIncrement'
xuxu-x86_64-w64-mingw32-g++-4.8.1.o:xuxu.cc:(.text$_ZN5boost6detail21intrusive_ptr_releaseEPNS0_16thread_data_baseE[_ZN5boost6detail21intrusive_ptr_releaseEPNS0_16thread_data_baseE]+0xe):
undefined reference to `__imp_InterlockedDecrement'
/cm/shared/apps/soft/bal/usr/mingw64-4.8.1/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../x86_64-w64-mingw32/bin/ld:
xuxu-x86_64-w64-mingw32-g++-4.8.1.o: bad reloc address 0xe in section
`.text$_ZN5boost6detail21intrusive_ptr_releaseEPNS0_16thread_data_baseE[_ZN5boost6detail21intrusive_ptr_releaseEPNS0_16thread_data_baseE]'
collect2: error: ld returned 1 exit status

Frédéric


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk