Boost logo

Boost Users :

From: Tim Murray (creative_at_[hidden])
Date: 2005-12-04 16:17:31


Hi,

I have successfully compiled the boost libs for the serialization
library using bjam and I am now trying to make use of it in my project.
 I am building my project in MSVC8. It has successfully compiled and
run in Release mode, but I am getting a compiler error in Debug mode on
the same code and am at a loss as to what the problem is.

The compiler error I am getting is:

iserializer.hpp(252) : error C2065: '()' : undeclared identifier

Here's a bit from the template stack trace:

...iserializer.hpp(252) : error C2544: expected ')' for operator '()'
...iserializer.hpp(251) : while compiling class template member function
'World::CWorld *boost::archive::detail::heap_allocator<T>::invoke(void)'
1> with
1> [
1> T=World::CWorld
1> ]

The following is the class this is complaining about:

namespace World
{
    class CWorld
    {
    friend class boost::serialization::access;
    template<class Archive>
    void save(Archive & ar, const unsigned int version) const;
    template<class Archive>
    void load(Archive & ar, const unsigned int version);
    BOOST_SERIALIZATION_SPLIT_MEMBER()

    public:
        ~CWorld();

        static CWorld* getWorld(){ return m_world; }
        static bool loadWorld(std::string filename);
        static bool saveWorld(std::string filename);
        static bool unloadWorld();

    protected:
        CWorld();

        static CWorld *m_world;
    };
}

And the source of the error traces back to the following member function:

bool CWorld::loadWorld(std::string filename)
{
    if(m_world)
        return false;
    
    m_world = new CWorld();

    // create and open an archive for input
    std::ifstream ifs(filename.c_str(), std::ios::binary);
    boost::archive::text_iarchive ia(ifs);
    // read class state from archive
    ia & *m_world; //!!!this is the line that the error traces to
    return true;
}

Like I said - this code compiles fine under Release mode, but this error
keeps showing up on Debug mode. Any ideas on what might be wrong? And
if you need more information, just ask.

Thanks,
Tim Murray


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