|
Boost Users : |
From: Robert Ramey (ramey_at_[hidden])
Date: 2006-02-01 12:25:42
I compiled the following program wiht no errors on my vc 7.1 system with no
errors or warnings
Robert Ramey
#include <fstream>
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp>
#include <boost/serialization/base_object.hpp>
#include <boost/serialization/utility.hpp>
class gps_position
{
friend std::ostream & operator<<(std::ostream &os, const gps_position &gp);
friend class boost::serialization::access;
int degrees;
int minutes;
float seconds;
template<class Archive>
void serialize(Archive & ar, const unsigned int /* file_version */){
ar & degrees & minutes & seconds;
}
public:
// every serializable class needs a constructor
gps_position(){};
gps_position(int _d, int _m, float _s) :
degrees(_d), minutes(_m), seconds(_s)
{}
};
void save(const std::string & filename)
{
//boost::recursive_mutex::scoped_lock lock(_nodeMutex);
std::ofstream outFile;
outFile.open(filename.c_str(), std::ios::binary);
boost::archive::text_oarchive archiveFile(outFile);
// simple test
const gps_position g;
archiveFile << g;
outFile.close();
}
Robert Ramey
cheesy4poofs wrote:
>> Try removing the line
>>
>>> #include <boost/serialization/type_info_implementation.hpp>
>>
>> And let me know that happens.
>>
>> I believe this problem is a remnant of a header depency issue which
>> will be addressed in the next release.
>>
>> Robert Ramey
>
> Thanks for the response. I actually didn't have that #include in my
> original code. I added it in a futile attempt to see if that would
> fix the issue. I still see the same compile errors when I remove
> that #include line.
>
> Scott
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