Boost C++ Libraries: Ticket #4375: [serialization] Build failures on Mingw https://svn.boost.org/trac10/ticket/4375 <p> Most of the serialization tests are failing on Mingw (see the RW_Mingw45 runner on <a href="http://www.boost.org/development/tests/trunk/developer/serialization.html">http://www.boost.org/development/tests/trunk/developer/serialization.html</a>). </p> <p> The test results don't tell you whats failing, but the actual log shows that it's a linking error when building the lib as a .dll: </p> <pre class="wiki">Creating library file: bin.v2\libs\serialization\build\gcc-mingw-4.5.0\release\threading-multi\libboost_serialization-mgw45-mt-1_44.dll.abin.v2\libs\serialization\build\gcc-mingw-4.5.0\release\threading-multi\basic_serializer_map.o:basic_serializer_map.cpp:(.text+0x17): undefined reference to `_imp___ZNK5boost13serialization18extended_type_infoltERKS1_' bin.v2\libs\serialization\build\gcc-mingw-4.5.0\release\threading-multi\basic_serializer_map.o:basic_serializer_map.cpp:(.text+0xb1): undefined reference to `_imp___ZNK5boost13serialization18extended_type_infoltERKS1_' bin.v2\libs\serialization\build\gcc-mingw-4.5.0\release\threading-multi\basic_serializer_map.o:basic_serializer_map.cpp:(.text+0xf2): undefined reference to `_imp___ZNK5boost13serialization18extended_type_infoltERKS1_' bin.v2\libs\serialization\build\gcc-mingw-4.5.0\release\threading-multi\basic_serializer_map.o:basic_serializer_map.cpp:(.text$_ZNSt8_Rb_treeIPKN5boost7archive6detail16basic_serializerES5_St9_IdentityIS5_ENS2_20basic_serializer_map25type_info_pointer_compareESaIS5_EE16_M_insert_uniqueERKS5_[std::_Rb_tree&lt;boost::archive::detail::basic_serializer const*, boost::archive::detail::basic_serializer const*, std::_Identity&lt;boost::archive::detail::basic_serializer const*&gt;, boost::archive::detail::basic_serializer_map::type_info_pointer_compare, std::allocator&lt;boost::archive::detail::basic_serializer const*&gt; &gt;::_M_insert_unique(boost::archive::detail::basic_serializer const* const&amp;)]+0x22): undefined reference to `_imp___ZNK5boost13serialization18extended_type_infoltERKS1_' bin.v2\libs\serialization\build\gcc-mingw-4.5.0\release\threading-multi\basic_serializer_map.o:basic_serializer_map.cpp:(.text$_ZNSt8_Rb_treeIPKN5boost7archive6detail16basic_serializerES5_St9_IdentityIS5_ENS2_20basic_serializer_map25type_info_pointer_compareESaIS5_EE16_M_insert_uniqueERKS5_[std::_Rb_tree&lt;boost::archive::detail::basic_serializer const*, boost::archive::detail::basic_serializer const*, std::_Identity&lt;boost::archive::detail::basic_serializer const*&gt;, boost::archive::detail::basic_serializer_map::type_info_pointer_compare, std::allocator&lt;boost::archive::detail::basic_serializer const*&gt; &gt;::_M_insert_unique(boost::archive::detail::basic_serializer const* const&amp;)]+0x72): undefined reference to `_imp___ZNK5boost13serialization18extended_type_infoltERKS1_' bin.v2\libs\serialization\build\gcc-mingw-4.5.0\release\threading-multi\basic_serializer_map.o:basic_serializer_map.cpp:(.text$_ZNSt8_Rb_treeIPKN5boost7archive6detail16basic_serializerES5_St9_IdentityIS5_ENS2_20basic_serializer_map25type_info_pointer_compareESaIS5_EE16_M_insert_uniqueERKS5_[std::_Rb_tree&lt;boost::archive::detail::basic_serializer const*, boost::archive::detail::basic_serializer const*, std::_Identity&lt;boost::archive::detail::basic_serializer const*&gt;, boost::archive::detail::basic_serializer_map::type_info_pointer_compare, std::allocator&lt;boost::archive::detail::basic_serializer const*&gt; &gt;::_M_insert_unique(boost::archive::detail::basic_serializer const* const&amp;)]+0x15e): more undefined references to `_imp___ZNK5boost13serialization18extended_type_infoltERKS1_' follow bin.v2\libs\serialization\build\gcc-mingw-4.5.0\release\threading-multi\shared_ptr_helper.o:shared_ptr_helper.cpp:(.text+0x50): undefined reference to `_imp___ZN5boost13serialization13void_downcastERKNS0_18extended_type_infoES3_PKv' bin.v2\libs\serialization\build\gcc-mingw-4.5.0\release\threading-multi\shared_ptr_helper.o:shared_ptr_helper.cpp:(.text+0x107): undefined reference to `_imp___ZN5boost13serialization11void_upcastERKNS0_18extended_type_infoES3_PKv ' collect2: ld returned 1 exit status </pre><p> The attached patch adds a #define BOOST_SERIALIZATION_SOURCE to a couple of serialization source files, which allows the build to work and most of the tests to pass (there are still a few failures, but i have't looked at those yet). </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4375 Trac 1.4.3 Richard Webb <richard.webb@…> Thu, 24 Jun 2010 14:58:47 GMT attachment set https://svn.boost.org/trac10/ticket/4375 https://svn.boost.org/trac10/ticket/4375 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">serialization-mingw.patch</span> </li> </ul> Ticket anonymous Fri, 25 Jun 2010 15:35:24 GMT <link>https://svn.boost.org/trac10/ticket/4375#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4375#comment:1</guid> <description> <p> Please look into this a little deeper. </p> <p> The facility provided by </p> <p> #define BOOST_SERIALIZATION_SOURCE </p> <p> Should be provided by #include &lt;boost/archive/detail/decl.hpp&gt; </p> <p> which should be included by another header. </p> <p> Robert Ramey </p> </description> <category>Ticket</category> </item> <item> <author>rwebb <richard.webb@…></author> <pubDate>Fri, 25 Jun 2010 17:04:54 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4375#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4375#comment:2</guid> <description> <p> I suggested the above change because what appeared to be causing the failure was that the absence of BOOST_SERIALIZATION_SOURCE in shared_ptr_helper.cpp and basic_serializer_map.cpp was resulting in BOOST_SERIALIZATION_DECL being set to <span class="underline">declspec(dllimport) when it needs to be </span>declspec(dllexport) for the dll build to work. </p> <p> There seems to be something else going on here as well though, as if i run the regression tests, i get loads of warnings along the lines of : </p> <pre class="wiki">gcc.link ..\..\..\bin.v2\libs\serialization\test\test_derived_text_archive.test\gcc-mingw-4.5.0\debug\test_derived_text_archive.exe Info: resolving vtable for boost::archive::archive_exception by linking to __imp___ZTVN5boost7archive17archive_exceptionE (auto-importc:/mingw450/bin/../lib/gcc/mingw32/4.5.0/../../../../mingw32/bin/ld.exe: warning: auto-importing has been activated without --enable-auto-import specified on the command line. This should work unless it involves constant data structures referencing symbols from auto-imported DLLs.) </pre><p> It doesn't seem to cause any problems with the tests, but i don't know how auto import works so i can't say anything more about it. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Fri, 02 Jul 2010 20:32:02 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4375#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4375#comment:3</guid> <description> <p> I've made a check in into the trunk to address this. Can you update and retest? </p> <p> Robert Ramey </p> </description> <category>Ticket</category> </item> <item> <author>rwebb <richard.webb@…></author> <pubDate>Sun, 04 Jul 2010 10:50:35 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4375#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4375#comment:4</guid> <description> <p> It's still failing for me, though with a different error. I'm attaching a build log from a release dll version of the lib. </p> </description> <category>Ticket</category> </item> <item> <author>rwebb <richard.webb@…></author> <pubDate>Sun, 04 Jul 2010 10:50:57 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/4375 https://svn.boost.org/trac10/ticket/4375 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">buildlog.zip</span> </li> </ul> Ticket Robert Ramey Tue, 14 Sep 2010 15:49:00 GMT status changed https://svn.boost.org/trac10/ticket/4375#comment:5 https://svn.boost.org/trac10/ticket/4375#comment:5 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> <p> I looked at this but still can't solve it. One thing I did notice was that the member function boost::serialization::extended_type_info::find(const char * key) is the only static function in the class. None of the other functions show up as unreferenced symbols. This could be a hint as to why the find function is the only one that might not be getting exported. I'm just leaving this note to remember this observation. I have no fix for now. </p> <p> Robert Ramey </p> Ticket Bryce Adelstein Lelbach Mon, 18 Oct 2010 00:54:14 GMT <link>https://svn.boost.org/trac10/ticket/4375#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4375#comment:6</guid> <description> <p> There seems to be three or so bugs on this issue (or related mingw issues with serialization). I'm going to take a look at it and see if I can I come up with a fix. </p> <p> Other bugs are <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4747" title="#4747: Bugs: mingw linker errors: undefined references (closed: fixed)">#4747</a>, <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4698" title="#4698: Bugs: serialization link errors mingw (closed: fixed)">#4698</a> and <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4699" title="#4699: Bugs: Can't build serialization as a DLL with mingw-w64 (closed: fixed)">#4699</a>. </p> <p> Bryce Lelbach </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Mon, 29 Nov 2010 20:33:35 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/4375#comment:7 https://svn.boost.org/trac10/ticket/4375#comment:7 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> Ticket