c++ - How to correctly link to boost with zlib on Windows? -
i've rebuild boost 1.57 on windows using msvc because want add support zlib:
.\b2 toolset=msvc-12.0 link=shared threading=multi address-model=64 --build-type=complete install -s no_zlib=0 -s zlib_source=d:\zlib128 this builds fine , generates new files boost_zlib-vc120-mt-1_57.dll , boost_zlib-vc120-mt-1_57.lib.
i'm using cmake add boost project:
find_package(boost ${boost_version} exact required components system date_time filesystem iostreams regex thread zlib) if(boost_found) add_definitions(${boost_definitions} -dboost_all_no_lib) include_directories(${boost_include_dirs}) link_directories(${boost_library_dirs}) target_link_libraries(foobar ${boost_libraries}) endif() in visual studio, see in "additional dependencies" boost_zlib-vc120-mt-1_57.lib listed there. trying compile this example fails linker error:
error 1730 error lnk2019: unresolved external symbol "int const boost::iostreams::zlib::default_compression" (?default_compression@zlib@iostreams@boost@@3hb) referenced in function "public: __cdecl boost::iostreams::detail::zlib_decompressor_impl >::zlib_decompressor_impl >(int)" (??0?$zlib_decompressor_impl@v?$allocator@d@std@@@detail@iostreams@boost@@qeaa@h@z)
how can fix this?
Comments
Post a Comment