Boost logo

Boost Users :

From: Jeshua Bratman (bratman_at_[hidden])
Date: 2007-08-13 14:31:20


Robert Ramey wrote:
>
> I compiled this code with the change below. Uncomment
> one of the serialization functions.
>

Hmm. I still couldn't compile it with those changes. Here's the cpp file I
tried to compile:

error.cpp:
#include <boost/serialization/base_object.hpp>
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp>

//BASE
class base
{
public:
  virtual void virt_func() = 0;
};
BOOST_IS_ABSTRACT(base);

//DERIVED
class derived : public base
{
public:
  void virt_func() {}
  template<class Archive>
  void serialize(Archive& ar, const unsigned int version);
};
#include <boost/serialization/export.hpp>
BOOST_CLASS_EXPORT_GUID(derived,"derived")

//MAIN
int main()
{
  return 0;
}

And when I try to compile it:

$ g++ error.cpp -lboost_serialization

/usr/include/boost/serialization/export.hpp: In static member function
'static void
boost::archive::detail::guid_initializer<T>::export_register(const char*)
[with T = derived]':
/usr/include/boost/serialization/export.hpp:155: instantiated from
'boost::archive::detail::guid_initializer<T>::guid_initializer(const char*)
[with T = derived]'
error.cpp:23: instantiated from here
/usr/include/boost/serialization/export.hpp:146: error: incomplete type
'boost::serialization::extended_type_info_null<derived>' used in nested name
specifier
/usr/include/boost/archive/detail/oserializer.hpp: In constructor
'boost::archive::detail::pointer_oserializer<T,
Archive>::pointer_oserializer() [with T = derived, Archive =
boost::archive::text_oarchive]':
/usr/include/boost/archive/detail/oserializer.hpp:198: instantiated from
'const boost::archive::detail::pointer_oserializer<derived,
boost::archive::text_oarchive>
boost::archive::detail::pointer_oserializer<derived,
boost::archive::text_oarchive>::instance'
/usr/include/boost/archive/detail/oserializer.hpp:190: instantiated from
'static const boost::archive::detail::pointer_oserializer<T, Archive>&
boost::archive::detail::pointer_oserializer<T, Archive>::instantiate() [with
T = derived, Archive = boost::archive::text_oarchive]'
/usr/include/boost/archive/detail/oserializer.hpp:515: instantiated from
'const boost::archive::detail::basic_pointer_oserializer&
boost::archive::detail::instantiate_pointer_oserializer(Archive*, T*) [with
Archive = boost::archive::text_oarchive, T = derived]'
/usr/include/boost/serialization/export.hpp:83: instantiated from 'static
void boost::archive::detail::export_impl::archive<Archive, T>::o::invoke()
[with Archive = boost::archive::text_oarchive, T = derived]'
/usr/include/boost/serialization/export.hpp:105: instantiated from 'static
void boost::archive::detail::export_impl::archive<Archive, T>::instantiate()
[with Archive = boost::archive::text_oarchive, T = derived]'
...
...
...
[Lots more errors]

-- 
View this message in context: http://www.nabble.com/Boost-Serialization-with-a-dynamically-loaded-shared-library-tf4238910.html#a12131501
Sent from the Boost - Users mailing list archive at Nabble.com.

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