Subject: Re: [Boost-bugs] [Boost C++ Libraries] #5341: Patch to improve shared library behavior with serialization
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-04-26 21:31:57
#5341: Patch to improve shared library behavior with serialization
----------------------------------------------+-----------------------------
Reporter: Aaron Barany <akb825@â¦> | Owner: ramey
Type: Patches | Status: reopened
Milestone: To Be Determined | Component: serialization
Version: Boost 1.46.0 | Severity: Problem
Resolution: | Keywords: serialization shared_libraries dlls
----------------------------------------------+-----------------------------
Comment (by Aaron Barany <akb825@â¦>):
I have attached a simple tester to demonstrate the issues with DLL
linking. (test dll.zip) This tester defines a separate archive (just a
copy of text_iarchive) and demonstrates how it will not compile with
unpatched boost, but will compile once my patches are applied. I detailed
why this is the case in comment 5.
If you want to use the solution and project files I provided, first you'll
have to have Visual Studio 2010 installed. If you don't own Visual Studio
2010, you can download the free express version here.
(http://www.microsoft.com/express/Downloads/#2010-Visual-CPP) It should
install beside any existing Visual Studio installation gracefully.
Additionally, you can re-use my source files and set up the project
yourself, making sure it links to the DLL build of boost.
I set up my project assuming you're compiling boost with the following
bjam parameters:
variant=debug link=shared threading=multi address-model=32
--toolset=msvc-10.0 stage
To compile the test, extract "test dll.zip" in the "libs\serialization"
directory. Open the "test dll.sln" solution and build with the debug/win32
configuration. With unpatched boost, it fails with the following errors:\\
1>c:\users\abarany.navteq\desktop\boosttest\boost_1_46_1\boost\archive\impl\archive_serializer_map.ipp(45):
error C2491:
'boost::archive::detail::archive_serializer_map<Archive>::insert' :
definition of dllimport function not allowed\\
1>c:\users\abarany.navteq\desktop\boosttest\boost_1_46_1\boost\archive\impl\archive_serializer_map.ipp(57):
error C2491:
'boost::archive::detail::archive_serializer_map<Archive>::erase' :
definition of dllimport function not allowed\\
1>c:\users\abarany.navteq\desktop\boosttest\boost_1_46_1\boost\archive\impl\archive_serializer_map.ipp(67):
error C2491:
'boost::archive::detail::archive_serializer_map<Archive>::find' :
definition of dllimport function not allowed
If you apply my patches and rebuild boost, when you rebuild the test dll
solution the build should succeed.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/5341#comment:13> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:06 UTC