simple example with boost/serialization?
I am trying to use the boost serialization library but can't compile even
the simplest demo.
The result of attempted compilation is below. Any help would be appreciated.
In particular, does anyone know of a *simple* example (with Makefiles, not
jam-files) which works with gcc? Something similar to the one quoted 2.5
years ago here:
http://aspn.activestate.com/ASPN/Mail/Message/boost/1437547
(this one is for the previous version of boost and does not work out of the
box now).
thanks, alex
system:
Debian Linux
boost 1.32
gcc 3.3.5
=========================
$ g++-3.3 -Wall -o demo demo.cpp
In file included from /usr/local/include/boost/config.hpp:35,
from /usr/include/boost/serialization/utility.hpp:21,
from demo.cpp:16:
/usr/local/include/boost/config/compiler/gcc.hpp:57:7: warning: #warning
"Unknown compiler version - please run the configure tests and report the
results"
In file included from
/usr/include/boost/serialization/type_info_implementation.hpp:24,
from /usr/include/boost/serialization/traits.hpp:33,
from /usr/include/boost/serialization/nvp.hpp:22,
from /usr/include/boost/serialization/utility.hpp:23,
from demo.cpp:16:
/usr/include/boost/serialization/extended_type_info_typeid.hpp:108: error:
parse
error before `::' token
In file included from
/usr/include/boost/serialization/type_info_implementation.hpp:30,
from /usr/include/boost/serialization/traits.hpp:33,
from /usr/include/boost/serialization/nvp.hpp:22,
from /usr/include/boost/serialization/utility.hpp:23,
from demo.cpp:16:
/usr/include/boost/mpl/eval_if.hpp:67: error: wrong number of template
arguments (3, should be 2)
/usr/local/include/boost/mpl/lambda_fwd.hpp:28: error: provided for `
template
Alex Makarenko wrote:
I am trying to use the boost serialization library but can't compile even the simplest demo. [snip] In file included from /usr/local/include/boost/config.hpp:35, from /usr/include/boost/serialization/utility.hpp:21, from demo.cpp:16: /usr/local/include/boost/config/compiler/gcc.hpp:57:7: warning: #warning "Unknown compiler version - please run the configure tests and report the results"
This looks wrong, boost 1.32 should know about gcc-3.3. Also, boost/config.hpp is in /usr/local/include, but boost/serialization/utility.hpp is in /usr/include. My guess is that you've got an old version of boost in /usr/local/include, and the pre-built debian packages in /usr/include There's a bug in the debian packages which causes some files to be lost during an upgrade to the new version, it looks like that has happened here. If I'm right then you should remove the boost packages, remove the old version from /usr/local and reinstall the boost packages (the bug only affects upgrades, not installs). Daniel
participants (2)
-
Alex Makarenko
-
Daniel James