Boost logo

Boost Users :

From: mauro gargano (mauro.gargano_at_[hidden])
Date: 2007-01-29 07:45:37


Hi everybody,

I'm having deep troubles with the serialization library. I need to
serialize a class (called VisualisationObject3D),
but every time I try to serialize it I get a static compile error
boost::STATIC_ASSERTION_FAILURE<x> referring to the line: oa << _obj
(below you find the error stack and the source code).

Since the error has to do with the tracking I tried disabling the
trackin also, but without success.

CAN SOMEBODY HELP ME?

thanks in advance,
Mauro.

------------------------ SOURCE CODE -------------------

class VisualisationPoint3D;

class VisualisationObject3D
{
public:

 VisualisationObject3D();
 ~VisualisationObject3D(){}
 std::vector<VisualisationPoint3D> m_vPoints;
}

void send_3D_object(VisualisationObject3D* _p){

tcpserialize::serialize_with_boost_to_socket<VisualisationObject3D>(_p,g_socket);

}

template<class T>
bool serialize_with_boost_to_socket(const T* _obj, StreamSocket* send_socket){

std::strstream ss;
{
boost::archive::text_oarchive oa(ss);
/*ERROR*/ oa << _obj;
}

char* _serialized_data=ss.rdbuf()->str();
size_t _serialized_data_size = ss.rdbuf()->pcount();
......

return true;
};

BOOST_CLASS_TRACKING(VisualisationPoint3D, boost::serialization::track_never)
BOOST_CLASS_TRACKING(VisualisationObject3D, boost::serialization::track_never)

namespace boost {
namespace serialization {

template<class Archive>
void serialize(Archive & ar, VisualisationPoint3D & o, const unsigned
int /* version */)
{
ar & ....;
}

template<class Archive>
void serialize(Archive & ar, VisualisationObject3D & o, const unsigned
int /* file_version */){
ar & .....;
}

} // namespace serialization
} // namespace boost

------------------------ ERROR -------------

the error stack is here attached:

d:\boost_1_33_1\boost\archive\detail\oserializer.hpp(567) : error
C2027: Verwendung des undefinierten Typs
"boost::STATIC_ASSERTION_FAILURE<x>"
     with
     [
         x=false
     ]
     d:\boost_1_33_1\boost\archive\detail\oserializer.hpp(567):
Siehe Verweis auf Instanziierung der kompilierten Klassenvorlage
'boost::STATIC_ASSERTION_FAILURE<x>'
     with
     [
         x=false
     ]
     d:\boost_1_33_1\boost\archive\basic_text_oarchive.hpp(78):
Siehe Verweis auf Instanziierung der kompilierten Funktionsvorlage
'void boost::archive::save<Archive,T>(Archive &,T & )'
     with
     [
         Archive=boost::archive::text_oarchive,
         T=const VisualisationObject3D *
     ]
     d:\boost_1_33_1\boost\archive\detail\interface_oarchive.hpp(78):
Siehe Verweis auf Instanziierung der kompilierten Funktionsvorlage
'void boost::archive::basic_text_oarchive<Archive>::save_override<T>(T
& ,int)'
     with
     [
         Archive=boost::archive::text_oarchive,
         T=const VisualisationObject3D *
     ]
     h:\SHARED\UNDER_REPOSITORY_CONTROL2\TEST_PROGRAMS\NetworkManagerDll\network-tools\tcpserialize.h(122):
Siehe Verweis auf Instanziierung der kompilierten Funktionsvorlage
'Archive &boost::archive::detail::interface_oarchive<Archive>::operator
<<<const T*>(const VisualisationObject3D & )'
     with
     [
         Archive=boost::archive::text_oarchive,
         T=VisualisationObject3D
     ]
     h:\SHARED\UNDER_REPOSITORY_CONTROL2\TEST_PROGRAMS\NetworkManagerDll\NetworkManager.cpp(46):
Siehe Verweis auf Instanziierung der kompilierten Funktionsvorlage
'bool tcpserialize::serialize_with_boost_to_socket<VisualisationObject3D>(const
T *,tcpserialize::StreamSocket *)'
     with
     [
         T=VisualisationObject3D
     ]


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