Boost logo

Boost Users :

Subject: [Boost-users] [boost 1.39][Serialization] BOOST_CLASS_EXPORT_GUID macro failed to compile with C2888 error under MSVS.
From: Vitaly Dolya (vitaly_at_[hidden])
Date: 2009-05-15 14:03:44


Hi, All!

Since I had no answer on my previous post, I'll try to clarify the problem here.
So, I use a macro BOOST_CLASS_EXPORT_GUID from Boost.Serialization library.
And everything was just fine until boost 1.39 came up to stage recently.
Now the same very of my code, I've been using for so long (starting with boost 1.35 I guess),
failed to compile under MS Visual Studio 2008 SP1. Compiler gives me an error
 
error C2888:
'boost::archive::detail::`anonymous-namespace'::init_guid<CSomeClass>' :
symbol cannot be defined within namespace 'anonymous-namespace'.

The error occurs when export.hpp file (contains BOOST_CLASS_EXPORT_GUID)
is included to stdafx.h (to precompiled headers) and the macro is used
in any other cpp-file. I guess the problem is that 'init_guid' structure
declaration (declared inside anonymous namespace) and definition appear
in different translation units.

So, it looks like there is a bug in boost 1.39 to me. Am I right?
And what should I do? Should I file a bug?

Thanks in advance.


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