Linker Error : Statically Linking of Boost Serialization Library
- by Manikanda raj S
I'm trying to link the Boost Serialization Library to my Code. But it doesn't seem to be working.
g++ serialize.cpp -L"/usr/local/lib/libboost_serialization.a"
Error :
/tmp/ccw7eX4A.o: In function boost::archive::text_oarchive::text_oarchive(std::basic_ostream<char, std::char_traits<char> >&, unsigned int)':
serializep.cpp:(.text._ZN5boost7archive13text_oarchiveC2ERSoj[_ZN5boost7archive13text_oarchiveC5ERSoj]+0x25):
undefined reference toboost::archive::text_oarchive_impl::text_oarchive_impl(std::basic_ostream &, unsigned int)'
..........
collect2: ld returned 1 exit status
But when i link as a shared library,
g++ serialize.cpp -lboost_serialization , it works fine.
What am i missing here
P.S : Other StackOverflow posts with the same question has no answers that work for the above error