Opened 15 years ago

Closed 15 years ago

#1290 closed Bugs (fixed)

Serialization export.hpp (or type_info_implementation.hpp) is NOT self-contained and causes compile error

Reported by: huangsean@… Owned by: Robert Ramey
Milestone: Component: serialization
Version: Boost 1.34.1 Severity: Showstopper
Keywords: Cc:

Description

The following code should compile:

#include <boost/serialization/export.hpp>

class A { };

BOOST_CLASS_EXPORT( A );

instead I got:

error C2027: use of undefined type 'boost::serialization::extended_type_info_impl<T>' 1> with 1> [ 1> T=A 1> ]

Change History (3)

comment:1 by Marshall Clow, 15 years ago

Component: Noneserialization
Owner: set to Robert Ramey

comment:2 by Julian <julian.magnone+boost@…>, 15 years ago

We are having the same problem.

We used the following macro instead and it worked fine but hasn't sense for us, because we are using gcc for compile the source code, and this Macro is for CodeWarrior.

export.hpp
166 CodeWarrior fails to construct static members of class templates
167
when they are instantiated from within templates, so on that
168 compiler we ask users to specifically register base/derived class
169
relationships for exported classes. On all other compilers, use of
170 this macro is entirely optional.
171 # define BOOST_SERIALIZATION_MWERKS_BASE_AND_DERIVED(Base,Derived) \
172 namespace \
173 { \
174 int BOOST_PP_CAT(boost_serialization_mwerks_init_, LINE) = \
175 (::boost::archive::detail::instantiate_ptr_serialization((Derived*)0,0), 3); \
176 int BOOST_PP_CAT(boost_serialization_mwerks_init2_, LINE) = ( \
177 ::boost::serialization::void_cast_register((Derived*)0,(Base*)0) \
178 , 3); \
179 }
180

comment:3 by Robert Ramey, 15 years ago

Milestone: To Be Determined
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.