BOOST_CLASS_VERSION compiles on MSVC2005, but not on gcc

Hello, I've got a problem using BOOST_CLASS_VERSION on gcc. The following minimal code example 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_; }; works for me both on gcc and on MSVC2005. However, if I add BOOST_CLASS_VERSION(CHeader, 1) 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? Thank you for your help, Regards S. Lorentz __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com

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
participants (2)
-
professor rumsdiegeige
-
Steven Watanabe