[serialization] mingw Deriving from boost::archive::xml_iarchive
Hi, We have a boost archive class derived from boost::archive::xml_iarchive_impl, like this: class XmlInputArchive : public boost::archive::xml_iarchive_impl< XmlInputArchive >, public boost::archive::detail::shared_ptr_helper Its purpose is to provide diagnostics information when deserialising xml archive input, ie. which tag is failing. In porting from 1_41 to 1_49 on mingw this no longer links because the boost::archive::basic_xml_grammar<char> class's symbols are no longer exported from the serialization library. The functions this class overrides are the protected functions: void load_start( const char * name ); void load_end( const char * name ); The existing boost::archive::xml_iarchive class derives from xml_iarchive_impl, and as these functions are protected in the latter, they are not available to a class derived from boost::archive::xml_iarchive class directly. And, for the same reason, we can't create an archive class that delegates to a boost::archive::xml_iarchive instance. So neither deriving from boost::archive::xml_iarchive nor using one as a delegate are feasible solutions. Is there a way of creating an xml_iarchive class that has access to the load_start, load_end functions? Or perhaps there is another way to get the diagnostics information about which xml tags are being processed? Thanks, Ken Appleby
Hi Ken, On Saturday, 23. June 2012 13:51:52 Ken wrote:
In porting from 1_41 to 1_49 on mingw this no longer links because the boost::archive::basic_xml_grammar<char> class's symbols are no longer exported from the serialization library.
This sounds odd. Are you sure you are setting BOOST_ALL_DYN_LINK and/or BOOST_SERIALIZATION_DYN_LINK during compilation? The export/import magic looks fine to me. And please provide a compilable testcase. There are flags and #defines which might trigger this behaviour. Yours, Jürgen -- * Dipl.-Math. Jürgen Hunold ! * voice: ++49 4257 300 ! Fährstraße 1 * fax : ++49 4257 300 ! 31609 Balge/Sebbenhausen * jhunold@gmx.eu ! Germany
On 23/06/2012 14:09, Jürgen Hunold wrote:
Hi Ken,
On Saturday, 23. June 2012 13:51:52 Ken wrote:
In porting from 1_41 to 1_49 on mingw this no longer links because the boost::archive::basic_xml_grammar<char> class's symbols are no longer exported from the serialization library.
This sounds odd. Are you sure you are setting BOOST_ALL_DYN_LINK and/or BOOST_SERIALIZATION_DYN_LINK during compilation? The export/import magic looks fine to me.
And please provide a compilable testcase. There are flags and #defines which might trigger this behaviour.
Yours,
Jürgen
Thanks Jürgen. No, we are not setting BOOST_SERIALIZATION_DYN_LINK.
Where should that be defined?
A minimal test case is below.
The evidence I was using, maybe erroneously, to claim that
boost::archive::basic_xml_grammar<char> symbols are not exported is that
a) nm stage/lib/libboost_serialization-mgw44-1_49.dll.a | grep grammar
produces nothing.
b) The file boost/archive/impl/basic_xml_grammar.hpp contains
declarations only. The implementation is defined in
libs/serialization/src/basic_xml_grammar.ipp and
libs/serialization/src/xml_grammar.cpp. Unlike the other serialization
classes, the code does not use BOOST_ARCHIVE_DECL or equivalent to
export the symbols.
Regards,
Ken
===================================
xmlia.hpp
# if ! defined __xmliarchive_h_
# define __xmliarchive_h_
#include
participants (2)
-
Jürgen Hunold
-
Ken