Boost logo

Boost :

From: Tiago da Silva (besbatti_at_[hidden])
Date: 2008-07-14 22:21:55

Hi there,

I am having some serious problems when trying to instantiate either a
boost::archive::xml_oarchive or a boost::archive::text_oarchive: everytime I
receive an

"Unhandled exception at XXX (msvcr90d.dll) in XXX : Access violation writing

I have simplified a test case up to this:

structure I want to save (in whatever.h):

        struct s_pt
            int x;
            int y;

            bool operator< (const struct s_pt &spt2) const
                return (x < spt2.x) && (y < spt2.y);

            bool operator== (const struct s_pt &spt2) const
                return (x == spt2.x) && (y == spt2.y);

            template<class Archive> // turns into a serializable
            void serialize(Archive &ar, const unsigned int version)
                using boost::serialization::make_nvp;

                ar & make_nvp("x", x);
                ar & make_nvp("y", y);


saving routine in main.cpp

    std::ofstream ofs("savedProject.imag3d");

    boost::archive::xml_oarchive oa(ofs);

    const structs::POINT2D p = {111, 222};

    oa << boost::serialization::make_nvp("p2d", p);

but I get this error in

    boost::archive::xml_oarchive oa(ofs);

I have tried already both xml_oarchive and text_oarchive... but the demo.cpp
provided by

involving the bus routes works!!!

what am I doing wrong???

I use Visual Studio 2008.

Thanks in advance,


Boost list run by bdawes at, gregod at, cpdaniel at, john at