Boost logo

Boost Users :

Subject: Re: [Boost-users] [serialization] Undefined symbol
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2011-02-16 10:46:19


AMDG

On 2/16/2011 5:26 AM, John Reid wrote:
> Digging a bit deeper in the boost code I found the undefined symbol in
> boost/serialization/version.hpp:
>
> // default version number is 0. Override with higher version
> // when class definition changes.
> template<class T>
> struct version
> {
> template<class U>
> struct traits_class_version {
> typedef BOOST_DEDUCED_TYPENAME U::version type;
> };
>
> typedef mpl::integral_c_tag tag;
> // note: at least one compiler complained w/o the full qualification
> // on basic traits below
> typedef
> BOOST_DEDUCED_TYPENAME mpl::eval_if<
> is_base_and_derived<boost::serialization::basic_traits,T>,
> traits_class_version<T>,
> mpl::int_<0>
> >::type type;
> BOOST_STATIC_CONSTANT(int, value = version::type::value);
> };
>
>
> Perhaps BOOST_STATIC_CONSTANT isn't working here?

This is missing something important:

#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
template<class T>
int version<T>::value;
#endif

Can you file a trac ticket at http://svn.boost.org/

> I know it seems a bit
> unlikely. I've tried explicitly instantiating the template and defining
> the symbol myself but I can't seem to get any of these approaches to
> work. Why it would work in release mode but not debug is also a mystery
> to me.
>

Because it's a constant, it must be getting
optimized out in release mode.

In Christ,
Steven Watanabe


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