Boost logo

Boost Users :

Subject: Re: [Boost-users] Serialization, mpl: BOOST_CLASS_VERSION() macro causes gcc compile errors with Boost version 1.43
From: Clarke, Carus V (carus.v.clarke_at_[hidden])
Date: 2010-07-01 12:10:05

Robert Ramey wrote:
> Clarke, Carus V wrote:
> > Using Boost version 1.43 to compile my project caused the following
> > errors to occur. There are more, but they are essentially the same:
> >
> > I was able to verify that these were caused by the BOOST_CLASS_VERSION
> > macro appearing on the same line in two or more files included by the
> > file being compiled. Using the BOOST_PP_COUNTER from the preprocessor
> > library as the argument to a #line directive on the line preceding the
> > BOOST_PP_COUNTER macro can be used as a workaround. Another was to
> > disable the MPL assertion in the body of the macro. For class
> > versioning to work for gcc, the BOOST_PP_COUNTER macro has to appear
> > in a header file, and I think it is better to put it in the header
> files for the classes to be serialized.
> >
> > Here is a sample of the workaround:
> >
> > // the next two lines are needed to prevent compile-time errors with
> > BOOST_CLASS_VERSION(Calculation, 0)
> >
> > Is there a better way to handle the problem? Is this a bug?
> Hmmmm - this will require some thought. The best thing would be to open up a track item for this so it doesn't get forgotten.
> Robert Ramey


This problem has been fixed in the SVN trunk version of boost/serialization/version.hpp. Installing the revised file made the problem go away.


Carus V. (Bud) Clarke

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at