Opened 7 years ago
Last modified 6 years ago
#11548 new Bugs
Crosscompiling 1.59 with i686-w64-mingw32-g++ fails
| Reported by: | Owned by: | Robert Ramey | |
|---|---|---|---|
| Milestone: | To Be Determined | Component: | serialization |
| Version: | Boost 1.59.0 | Severity: | Problem |
| Keywords: | Cc: |
Description
Using
using gcc : i686 : i686-w64-mingw32-g++ ;
in tools/build/src/user-config.jam
with i686-w64-mingw32-g++ (GCC) 4.8.2
and calling
./b2 toolset=gcc-i686 address-model=32 link=shared --stagedir=Win32 target-os=windows threading=multi threadapi=win32 variant=release --with-date_time --with-filesystem --with-graph --with-math --with-program_options --with-serialization --with-system --with-thread --with-timer
gives compiler errors
gcc.compile.c++ bin.v2/libs/serialization/build/gcc-mingw-i686/release/target-os-windows/threadapi-win32/threading-multi/text_woarchive.o In file included from ./boost/archive/detail/common_oarchive.hpp:21:0,
from ./boost/archive/basic_text_oarchive.hpp:29, from ./boost/archive/text_woarchive.hpp:36, from libs/serialization/src/text_woarchive.cpp:17:
./boost/archive/detail/basic_oarchive.hpp:64:5: error: function ‘boost::archive::detail::helper_collection& boost::archive::detail::basic_oarchive::get_helper_collection()’ definition is marked dllimport
get_helper_collection(){
In file included from ./boost/archive/detail/common_oarchive.hpp:22:0,
from ./boost/archive/basic_text_oarchive.hpp:29, from ./boost/archive/text_woarchive.hpp:36, from libs/serialization/src/text_woarchive.cpp:17:
./boost/archive/detail/interface_oarchive.hpp:32:38: warning: type attributes ignored after type is already defined [-Wattributes]
class BOOST_ARCHIVE_OR_WARCHIVE_DECL basic_pointer_oserializer;
Crosscompiling 64bit version with x86_64-w64-mingw32-g++ (GCC) 4.8.2 also fails.
Change History (4)
comment:1 by , 7 years ago
comment:2 by , 7 years ago
With the above patch compiling works, but there is a linking error:
gcc.link.dll bin.v2/libs/serialization/build/gcc-mingw-x86_64/release/target-os-windows/threadapi-win32/threading-multi/libboost_wserialization.dll.a bin.v2/libs/serialization/build/gcc-mingw-x86_64/release/target-os-windows/threadapi-win32/threading-multi/basic_text_wiprimitive.o:basic_text_wiprimitive.cpp:(.text$_ZN5boost13serialization15throw_exceptionINS_7archive17archive_exceptionEEEvRKT_[_ZN5boost13serialization15throw_exceptionINS_7archive17archive_exceptionEEEvRKT_]+0x19): Nicht definierter Verweis auf `vtable for boost::archive::archive_exception' bin.v2/libs/serialization/build/gcc-mingw-x86_64/release/target-os-windows/threadapi-win32/threading-multi/xml_wgrammar.o:xml_wgrammar.cpp:(.rdata$_ZTCN5boost7archive21xml_archive_exceptionE8_NS0_17archive_exceptionE[_ZTCN5boost7archive21xml_archive_exceptionE8_NS0_17archive_exceptionE]+0x60): Nicht definierter Verweis auf `virtual thunk to boost::archive::archive_exception::~archive_exception()' bin.v2/libs/serialization/build/gcc-mingw-x86_64/release/target-os-windows/threadapi-win32/threading-multi/xml_wgrammar.o:xml_wgrammar.cpp:(.rdata$_ZTCN5boost7archive21xml_archive_exceptionE8_NS0_17archive_exceptionE[_ZTCN5boost7archive21xml_archive_exceptionE8_NS0_17archive_exceptionE]+0x68): Nicht definierter Verweis auf `virtual thunk to boost::archive::archive_exception::~archive_exception()' /usr/bin/x86_64-w64-mingw32-ld: bin.v2/libs/serialization/build/gcc-mingw-x86_64/release/target-os-windows/threadapi-win32/threading-multi/xml_wgrammar.o: Falsche Verschiebungsadresse 0x68 in Abschnitt `.rdata$_ZTCN5boost7archive21xml_archive_exceptionE8_NS0_17archive_exceptionE[_ZTCN5boost7archive21xml_archive_exceptionE8_NS0_17archive_exceptionE]'
comment:3 by , 7 years ago
I am facing the same error.
There is a "fix" (pull request) here: https://github.com/boostorg/serialization/pull/19
(But I cannot get the sources from that page?!)
comment:4 by , 6 years ago
| Component: | Building Boost → serialization |
|---|---|
| Owner: | set to |

This patch resolves this problem:
--- a/include/boost/archive/detail/basic_oarchive.hpp +++ b/include/boost/archive/detail/basic_oarchive.hpp @@ -60,7 +60,7 @@ class BOOST_SYMBOL_VISIBLE basic_oarchive : virtual void vsave(const tracking_type t) = 0; protected: BOOST_ARCHIVE_DECL basic_oarchive(unsigned int flags = 0); - BOOST_ARCHIVE_DECL boost::archive::detail::helper_collection & + virtual boost::archive::detail::helper_collection & get_helper_collection(){ return *this; }