vs2017 编译 boost1.68

下载

前往Boost官网下载:https://www.boost.org/users/history/version_1_68_0.html

解压到指定目录(路径可以随意选择,最好不要包含中文和空格,e.g,E:\ThirdPart\boost_1_68_0)

编译

1.运行引导程序

使用VS命令行工具在Boost的解压目录执行 ./bootstrap.bat,生成包b2.exe和bjam.exe;

2.编译

生成动态库并保存到 vc142 文件夹中

.\b2 install --prefix="vc142" --toolset=msvc-14.2 link=shared runtime-link=shared threading=multi debug release  address-model=64

生成静态库并保存到 vc142 文件夹中

.\b2 install --prefix="vc142" --toolset=msvc-14.2 link=static runtime-link=shared threading=multi debug release  address-model=64

3.参数说明

install/stage
install:将头文件以及库文件拷贝到prefix指定的路径;

stage:将生成的库文件拷贝到stagedir指定的路径;

toolset
指定编译使用的编译器:msvc-14.1(vs2017),msvc-14.0(vs2015),msvc-12.0(vs2013),msvc-11.0(vs2012),msvc-10.0(vs2010),

prefix/stagedir
prefix:指定安装路径,配合install使用;

stagedir:指定库文件生成路径,配合stage使用;

link
指定生成的库文件是静态库还是动态库:static-静态库、shared-动态库;

runtime-link
使用的C/C++运行时库是动态库还是静态库:static-静态库、shared-动态库;

threading
生成多线程库还是单线程库:multi-多线程、single-单线程

debug/release
生成库的版本,默认都编译

address-model
32位还是64位,默认都编译;

Ubuntu 编译

./bootstrap.sh --prefix=/home/hu/hu/cmake-all-apps/boost_1_68_0/build
./b2 install --prefix=/home/hu/hu/cmake-all-apps/boost_1_68_0/build

编译 VTK:
1.报 X11_Xt_LIB could not be found. Required for VTK X lib.
sudo apt-get install libxt-dev

2.报:Ubuntu Add the installation prefix of “Qt5“ to CMAKE_PREFIX_PATH or set “Qt5_DIR“
【Add Entry】 key:CMAKE_PREFIX_PATH value:/home/hu/Qt5.12.8/5.12.8/gcc_64/
export CMAKE_PREFIX_PATH=/home/hu/Qt5.12.8/5.12.8/gcc_64/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值