I have a very simple class, which I will send as Object via TCP using Asio by boost. I found many examples on the Internet, but when I compile my code I get a Link Failure.
#include <boost/archive/text_oarchive.hpp>
void async_write(){
std::ostringstream archive_stream;
boost::archive::text_oarchive archive(archive_stream); // here it fails
//....
}
I downloaded boost via macports.
My Qt project file:
INCLUDEPATH += /opt/local/include
LIBS += -L/opt/local/lib
LIBS += -lboost_system-mt -lboost_filesystem-mt -lboost_serialization-mt
Failure:
Undefined symbols for architecture x86_64: "boost::archive::text_oarchive_impl::save(std::string const&)", referenced from: void boost::archive::save_access::save_primitive(boost::archive::text_oarchive&, std::string const&) in tcpsession.o "boost::archive::text_oarchive_impl::text_oarchive_impl(std::ostream&, unsigned int)", referenced from: boost::archive::text_oarchive::text_oarchive(std::ostream&, unsigned int) in tcpsession.o "boost::archive::basic_text_oprimitive::~basic_text_oprimitive()", referenced from: boost::archive::text_oarchive_impl::~text_oarchive_impl() in tcpsession.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: * [tcpserver] Error 1
Any help is appreciated.
libboost_serialization-mt.a
actually exist on the linker path? – Igor R.