boost serializierung

Hi,

irgendwie spinnt mein boost::serialization lib. Könnte vielleicht jemand diesen Code unter Windows übersetzen und mir sagen ob er ohne Probleme läuft :

Code:
#include <boost/archive/text_iarchive.hpp>
#include <boost/archive/text_oarchive.hpp>
#include <fstream>
#include <iostream>

class X
{
    public:
        X():_x(0),_y(0)
        {}
    protected:
        friend class boost::serialization::access;
        template<class Archive>
        void serialize(Archive & ar, const unsigned int /* file_version */)
        {
            ar & _x;
            ar & _y;
        }
    private:
        int _x;
        int _y;
};

int main(void)
{
    const X x;
    try
    {
        std::ofstream ofs("profile.dat");
        boost::archive::text_oarchive oa(ofs);
        oa << x;
    }catch(std::exception &ex)
    {
        std::cerr<<ex.what()<<std::endl;
    }

    return 0;
}

ich habe sie schon paar mal neu übersetzt aber es will einfach nicht klappen. Unter Linux geht es komischerweise...
 
Zurück
Oben