Boost logo

Boost Users :

From: Robert Ramey (ramey_at_[hidden])
Date: 2004-11-29 17:47:09


To really solve this problem, do the following:

In your private copy of boost/serialization/shared_ptr.hpp replace

#ifdef BOOST_SHARED_PTR_HPP_INCLUDED
#error "include <boost/serialization/shared_ptr> first"
#endif
#define private public
#include <boost/shared_ptr.hpp>
#undef private

with just:

#include <boost/shared_ptr.hpp>

Now when you compile, you'll get a couple of error like ... is not
accessible. In your private copy of boost/shared_ptr.hpp move the problem
variables out of the private section to the public section.

Sorry. this is the only current option.

Robert Ramey

change
"Jeffrey Holle" <jeff.holle_at_[hidden]> wrote in message
news:cod5pm$tgm$1_at_sea.gmane.org...
> I'm attempting to apply the boost::serialization library to my
application.
>
> Because it is fairly large, I've choosing to implement the serialize
> methods as non-templates. Such a tactic is used in some of the
> examples, for instance demo_polymorphic_A.hpp. This means that I don't
> include any boost.serialization or boost.archive headers in my
> definition files. A forward reference to the specific archive object is
> made instead.
>
> I've run into trouble with an object wrapped in a shared_pointer.
> To solve this, I've attempted to defined the
> BOOST_SHARED_POINTER_EXPORT() macro in this object's definition file.
> This necessitates including boost/serialization/shared_ptr.hpp.
>
> The problem is no matter what position I place this include file in this
> *.h file, I get the following error.
> boost/serialization/shared_ptr.hpp:26:2: #error "include
> <boost/serialization/shared_ptr> first
>
> This is a self reference, what is it trying to say?
>
> In other words, what do I have to include before
> boost/serialization/shared_ptr.hpp to make it happy?


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