|
Boost Users : |
Subject: Re: [Boost-users] BOOST_CLASS_VERSION compiles on MSVC2005, but not on gcc
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-10-24 18:21:47
AMDG
professor rumsdiegeige wrote:
> I've got a problem using BOOST_CLASS_VERSION on gcc.
>
> <snip>
>
> then the code only compiles on MSVC2005, but not on gcc. GCC complains
> about an incorrect syntax here, without being more specific.
>
> What am I doing wrong?
What version of Boost are you using? What version of gcc?
Can you provide a complete example of what you
are trying to compile? The following compiles for me with
gcc-3.4.4 and gcc-4.3.0 against all versions of boost from
1.33.1 to the trunk
#include <boost/noncopyable.hpp>
#include <boost/serialization/access.hpp>
#include <boost/serialization/version.hpp>
class CHeader : boost::noncopyable
{
public:
CHeader() {PosX_ = 1.0;};
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive & ar, const unsigned int version)
{
ar & PosX_;
}
double PosX_;
};
BOOST_CLASS_VERSION(CHeader, 1)
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