Linker Error : Statically Linking of Boost Serialization Library

Posted by Manikanda raj S on Stack Overflow See other posts from Stack Overflow or by Manikanda raj S
Published on 2012-09-28T16:55:30Z Indexed on 2012/09/29 3:37 UTC
Read the original article Hit count: 147

Filed under:
|
|

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

© Stack Overflow or respective owner

Related posts about c++

Related posts about boost