Boost logo

Boost Users :

From: Sebastien Gerega (seb_at_[hidden])
Date: 2005-09-02 07:31:04


Ok thanks that helped.
Now I got another problem. I can't put the

std::ostream&
*operator*<<(std::ostream& os, const ResData& rD){
    *return* os << rD.getResName() << rD.getSeqNum() << rD.getInsNum() << rD.getSAS();
}

in ResData.h because that results in multiple definition errors. But
when I put it in ResData.cpp I get the following error:
/usr/include/boost/serialization/access.hpp:109: undefined reference to
`void
ResData::serialize<boost::archive::text_oarchive>(boost::archive::text_oarchive&,
unsi

how do I get around this problem?
thanks again,
Sebastien Gerega

Vladimir Prus wrote:

>Sebastien Gerega wrote:
>
>
>
>>int main(){
>>
>> std::ofstream oFSBS("/home/Seb/Code/testData/results.dat");
>> boost::archive::text_oarchive oA(oFSBS);
>> ResData temp("TEST", 1, 1);
>> temp.setSAS(5555);
>> oA << temp;
>>
>>
>
>You need to use
>
> const ResData& work_around = temp;
> oA << temp;
>
>For 1.33, Robert decided that you can't save non-const objects like this.
>Many objected, but we failed to persuade him.
>
>- Volodya
>
>_______________________________________________
>Boost-users mailing list
>Boost-users_at_[hidden]
>http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
>
>


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