(Editor’s note: see the wiki for a more structured and updated version…)
I wrote an object-oriented database a few years back using “C++ Database Development” from Al Stevens as inspiration, and I’ve always wanted to dig it out and get it updated. I’m also working on ShareTheDJ, which needs cross-platform object serialization. Robert Ramey implemented boost::serialization and it looks like an excellent way to serialize my objects in a more STL-friendly way. Here’s how to set up under FC3/FC4, gentoo and Windoze…
UPDATE: Sourceforge root changed from [cvs-pserver.sf.net:443] to [boost.cvs.sourceforge.net]. Instructions were updated.
The following instructs you on how to obtain and build the latest boost code from the CVS repository, and set up boost and the boost::serialize library for development under Windows, Fedora FC3/FC4, and gentoo.
Gentoo/Fedora FC4/FC5 + gcc
cvs -d:pserver:[email protected]/cvsroot/boost login
cvs -z3 -d:pserver:[email protected]/cvsroot/boost co -P boost
configure.in: CPPFLAGS=”${CPPFLAGS} -I/usr/local/include/boost-#version#”
Makefile.am: yourproject_LDADD = (…) /usr/local/lib/libboost_serialization-gcc.aNow you should be good to go! Grab some sample code and have at it.
VC 7.1
Right-click in the directory where you want boost, and select “Checkout…”
Protocol = :pserver:
Server = boost.cvs.sourceforge.net
Port = default
Repository folder = /cvsroot/boost
User name = anonymous
Module = boost
…updated 1123 targets…
Automatic linking support will be introduced in a future release.
So we need to manually include the serialize library in our VC++ project. With a little experimentation, here’s my guesses at what to use:
DYNAMICALLY LINKED C RUNTIME LIBRARY
- Multi-threaded (MT): libboost_serialization-vc71-mt.lib
- MT debug: libboost_serialization-vc71-mt-gd.lib
STATICALLY LINKED C RUNTIME LIBRARY
- MT: libboost_serialization-vc71-mt-s.lib
- MT debug: libboost_serialization-vc71-mt-sgd.lib
- ST: libboost_serialization-vc71-s.lib
- ST debug: libboost_serialization-vc71-sgd.lib
Grab the sample code from the serialize docs. And off we go!