[serialization] I am unable to link the serialization demo.cpp

I would like to use the boost serialization library to do checkpointing for a simulation which runs for one or more weeks. However, I have not been able to get past the "hello world" stage. I have tried to do this on both a linux machine running gcc 3.4.5 and Mac OS X using gcc 3.3. In both cases, my attempts to compile the demo.cpp program fail with long lists of undefined symbols. I will give the specifics for the Mac because this is where it will ultimately be used and because the instalation seems more standard there. The demo.cpp I am trying to compile is the one available on http://www.boost.org/libs/serialization/doc/tutorial.html The boost include files are installed in /usr/local/boost/gcc/ The libraries are installed in /usr/local/lib/ For example, here I find libboost_serialization.a and libboost_serialization.dylib. I am attempting to compile as follows: gcc \ -L/usr/local/lib/ \ -I/usr/local/include/ \ -lboost_serialization \ demo.cpp I have tried various variations on this including adding all the .a files to the list of libraries to link, and adding stdc++. I get error messages of which the following are typical ld: Undefined symbols: __ZNKSs5c_strEv __ZNKSt9basic_iosIcSt11char_traitsIcEE4failEv __ZNSaIcEC1Ev __ZNSaIcED1Ev followed by more of the same. I have no doubt there is something very simple I am failing to do, very likely something so simple no one knowledgeable would think to put it in the documentation. So I will probably feel very dumb when someone educates me about this, but I will also feel very relieved. Thanks in advance for your help.

Michael Shapiro wrote:
I have tried various variations on this including adding all the .a files to the list of libraries to link, and adding stdc++. I get error messages of which the following are typical
ld: Undefined symbols: __ZNKSs5c_strEv __ZNKSt9basic_iosIcSt11char_traitsIcEE4failEv __ZNSaIcEC1Ev __ZNSaIcED1Ev
followed by more of the same.
I have no doubt there is something very simple I am failing to do.
FWIW the message seem to indicate that it can't find definition for basic_ios, c_str etc. These are not defined in the boost serialization library but rather somewhere else. So maybe its not the serialization library that is not being found but some other library. Just a small observaton Robert Ramey
participants (2)
-
Michael Shapiro
-
Robert Ramey