Boost logo

Boost Users :

Subject: Re: [Boost-users] Error: guid_defined is not templateBOOST_CLASS_EXPORT_GUID
From: Jari (jaristr_at_[hidden])
Date: 2011-05-10 11:09:17


On Tue, May 10, 2011 at 8:57 AM, Robert Ramey <ramey_at_[hidden]> wrote:
> Jari wrote:
>> Hi
>> I am using boost serialization and it was working fine (save load
>> works) but then I tried using BOOST_CLASS_EXPORT_GUID and get weird
>> error.
>>
>> The line that gives the error is this:
>>
>> BOOST_CLASS_EXPORT_GUID( Bakery, "Bakery")
>>
>>
>> (I put the code in Cpp to avoid any problems with headers.)
>>
>>
>> And this is the full Visual studio express 2010 error:
>>
>> 2>E:\boost_1_46_1\boost/archive/detail/check.hpp(162): error C2338:
>> typex::value
>
> ...
>
> what does the code look like at line 162 of check.hpp ?
>
> Robert Ramey

Here's part of check.hpp where the problem is:

template<class T>
inline void check_const_loading(){
    typedef
        BOOST_DEDUCED_TYPENAME mpl::or_<
            BOOST_DEDUCED_TYPENAME boost::serialization::is_wrapper< T >,
            BOOST_DEDUCED_TYPENAME mpl::not_<
                BOOST_DEDUCED_TYPENAME boost::is_const< T >
>
>::type typex;
    // cannot load data into a "const" object unless it's a
    // wrapper around some other non-const object.
    BOOST_STATIC_ASSERT(typex::value); // <-------------
Compiler points here for the error
}

} // detail
} // archive
} // boost

I must also say that I got all the code working in small test project
but this error comes up in my big project.


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