Boost logo

Boost Users :

From: Deane Yang (deane_yang_at_[hidden])
Date: 2006-11-23 02:56:28


Robert Ramey wrote:
> Deane Yang wrote:
>> First, I am trying to figure out how to use BOOST_CLASS_EXPORT. I am
>> trying to do it using the following advice from the documentation:
>>
>> "As noted in the comments, this would work. But #include
>> <.../export.hpp> can't be used without conflicting with other modules
>> which use #include <.../*archive.hpp>. In this case we can move the
>> export to an implementation file:
>
> Where did you find this in the documentation? I know its in there but
> I can't find it when I look for it in the HEAD.

Reference -> Special Considerations -> Exporting Class Serialization
(at the very end)

>>
>> In fact, my implementation file contains *only* BOOST_CLASS_EXPORT
>> statements.
>
> Then no code will be instantiated - as you have indeed found.

What else is supposed to be in this file? Do I need to put in the code
that loads and saves archives in this file?

>
>> Code like this seems to compile only if I also include archive
>> headers like: #include <boost/archive/xml_oarchive.hpp>
>> #include <boost/archive/xml_iarchive.hpp>
>
> correct.
>
>> If these directives are omitted, then my code does not compile.
>
> Hmmm - the required code to export class x to archive xml_?archive.hpp
> will not be instantiated. I would expect that to show up as a missing
> symbol during linking.

No, I get something like:

..\..\..\..\vendor\boost\boost/serialization/type_info_implementation.hpp(48)
: error C2027: use of undefined type
'boost::serialization::extended_type_info_impl<T>'
         with
         [
             T=Input::Bond
         ]
         ..\..\..\..\vendor\boost\boost/serialization/export.hpp(75) :
see reference to class template instantiation
'boost::serialization::type_info_implementation<T>' being compiled
         with
         [
             T=Input::Bond
         ]

>
> Send me a little code that reproduces the problem.
>

I'll see if I can reproduce my error with a simple example.

Thanks!
Deane


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net