Download bzip2 library from bzip.org. Unpack it to c:\lib\bzip2-1.0.5 (in example). Compile boost lib with bzip2 support c:\lib\boost_1_42_0>bjam –without-python –without-mpi -sBZIP2_INCLUDE=c:\lib\bzip2-1.0.5 -sBZIP2_LIBPATH=c:\lib\bzip2-1.0.5 -sBZIP2_SOURCE=c:\lib\bzip2-1.0.5 -sBZIP2_BINARY=libbz2.lib variant=release link=static –toolset=msvc threading=multi –build-type=complete stage Let’s write some code #define BOOST_HAS_HASH #include <boost/serialization/hash_map.hpp> #include <boost/archive/binary_oarchive.hpp> #include <hash_map> #include <fstream> #include <string> #include <boost/iostreams/filtering_streambuf.hpp> #include <boost/iostreams/filter/bzip2.hpp> int _tmain(int argc, [...]
Posted on April 29th, 2010 in C++, Software Developing
Posted on April 29th, 2010 in C++, Software Developing
How to serialize hash_map with boost. All we know that hash_map is non-standart feature and it’s not in STL. Therefore, hash_maps is supported with stdext, __gnu_cxx namespaces etc. As hash_maps is non-standart feature of STL, there is some troubles on (de)serialize it. #define BOOST_HAS_HASH #include <boost/serialization/hash_map.hpp> #include <boost/archive/binary_oarchive.hpp> #include <hash_map> #include <fstream> #include <string> [...]

