Boost 1.59.0, CMake 3.7.2

使用CMake编译时出现以下错误:


Error: Could not find the following Boost libraries:boost_serialization

无法找到以下库,但是编译好的库中是有libboost_serialization, libboost_system等这些文件的,就是链接不到,

因为Boost有静态和动态库,编译时两者都是需要编译的,如果按常规方法这些库就没有编译。

解决方面如下:

bjam.exe toolset=msvc-12.0 --build-type=complete address-model=64 --with-serialization --with-system --with-date_time --with-regex --with-filesystem --with-timer  --with-chrono  --with-program_options --stagedir="X:\X\Boost" stage
就是加上你所缺少的库,之后Boost\lib中就会出现 以下文件:


Error: Could not find the following Boost libraries:boost_serialization


这些就是我们所需要的文件,然后再次configure,成功!




相关文章: