Hi,<br><br>I want to use a non inline serialize method of a class. When<br>instantiating it not explicitly the linker quits with undefined symbols.<br>So I tried to instantiate it that way and it does not work anyway.<br>Here is my code. Does anyone see what I've done wrong? <br>I did also try to use export.hpp but it doesn't help too.<br>Thank you very much, Jan.<br><br>// Class.hpp<br><br>#include <boost/archive/xml_oarchive<div>.hpp><br>#include <boost/archive/xml_iarchive.hpp> <br>#include <boost/serialization/string.hpp> <br>#include <boost/serialization/base_object.hpp><br>#include <boost/serialization/utility.hpp><br><br>class CSerTest<br>{<br> std::string a_, b_, c_;<br> friend class boost::serialization::access;<br> template<class Archive> void serialize( Archive & ar, const unsigned int ); <br><br> public:<br> CSerTest();<br>};<br><br>BOOST_CLASS_VERSION(CSerTest, 1);<br><br>// Class.cpp<br><br>#include "Class.hpp"<br><br>CSerTest::CSerTest() : a_("1"), b_("2"), c_("3") <br>{<br><br>}<br><br>template<class Archive> void CSerTest::serialize( Archive & ar, const unsigned int )<br>{<br> ar & BOOST_SERIALIZATION_NVP(a_) & BOOST_SERIALIZATION_NVP(b_) & BOOST_SERIALIZATION_NVP(c_); <br>}<br><br>// main.cpp<br><br>#include <fstream><br>#include "Class.hpp"<br><br>///////////////////////// without effect ////////////////////////////////////<br>template void CSerTest::serialize<boost::archive::xml_oarchive>(boost::archive::xml_oarchive&, unsigned int ); <br><br>int main()<br>{<br> CSerTest instance;<br><br> std::ofstream ofs( "out_file.txt" );<br> boost::archive::xml_oarchive oxa( ofs );<br> <br> oxa << BOOST_SERIALIZATION_NVP(instance);<br> }<br><br>The linker (MS version 8) returns with:<br>---<br>Creating library mytest.lib and object mytest.exp<br>Main.obj : error LNK2019: unresolved external symbol "private: void<br>__thiscall CSerTest::serialize<class boost::archive::xml_oarchive>(class boost::archive::xml_oarchive &,unsigned int)"(??$serialize@ Vxml_oarchive@archive@boost@@@CSerTest@@AAEXAAVxml_oarchive@archive@boost@@I@Z) referenced in function "public: static void __cdeclboost::serialization::access::serialize<class boost::archive::xml_oarchive,class CSerTest>(class boost::archive::xml_oarchive &,class CSerTest &,unsigned int)"(??$serialize@ Vxml_oarchive@archive@boost@@VCSerTest@@@access@serialization@boost@@SAXAAVxml_oarchive@archive@2@AAVCSerTest@@I@Z)mytest.exe<br>: fatal error LNK1120: 1 unresolved externals</div>