1
我想編譯一個使用Boost的zlib包裝的代碼。但是,無論我做什麼,我都無法讓這個工作。在Linux上用zlib編譯boost
在我的cpp文件,我有以下標題:
#include <algorithm>
#include <fstream>
#include <vector>
#include <boost/archive/binary_oarchive.hpp>
#include <boost/archive/binary_iarchive.hpp>
#include <boost/serialization/vector.hpp>
#include <boost/iostreams/filter/zlib.hpp>
#include <boost/iostreams/filtering_stream.hpp>
我使用命令編譯:
g++ -O3 -ffast-math -funroll-loops -ansi -pedantic-errors -L/usr/lib -lboost_filesystem -lboost_serialization -lz -I /usr/include/boost -o zlib_test zlib_test.o
升壓本身運行命令後的bjam內置:
./bootstrap.sh --prefix=/home/anon/boost --with-libraries=filesystem,program_options,system,serialization
我得到的錯誤信息如下:
zlib_test.o: In function `boost::detail::sp_counted_impl_p<boost::iostreams::symmetric_filter<boost::iostreams::detail::zlib_compressor_impl<std::allocator<char> >, std::allocator<char> >::impl>::dispose()':
zlib_test.cpp:(.text._ZN5boost6detail17sp_counted_impl_pINS_9iostreams16symmetric_filterINS2_6detail20zlib_compressor_implISaIcEEES6_E4implEE7disposeEv[boost::detail::sp_counted_impl_p<boost::iostreams::symmetric_filter<boost::iostreams::detail::zlib_compressor_impl<std::allocator<char> >, std::allocator<char> >::impl>::dispose()]+0x30): undefined reference to `boost::iostreams::detail::zlib_base::reset(bool, bool)'
等....
我如何能得到這個代碼編譯任何想法?如果重要,這是在Centos 5機器上。