win10 vs2017安装boost库
发布时间
阅读量:
阅读量
1 boost发行版 https://dl.bintray.com/boostorg/release/1.66.0/binaries/
依据操作系统及Visual Studio版本选择相应的版本号:boost_1_66_0-msvc-14.1-64.exe(其中14.1对应Visual Studio 2017 64位)
2 安装过程应在完成下载后进行操作,并将配置路径设置至D:\OpenLib

3 位于boost安装目录中(D:\OpenLib\boost_1_66_0),执行名为bootstrap.bat的批处理脚本,将生成bjam.exe文件。

启动Visual Studio 2017 64位版本附带的命令行工具(也可通过Windows 10的搜索功能快速定位)
从命令行界面导航至Boost库的安装路径:D:\OpenLib\boost_1_66_0
于命令行窗口中键入指令:b2

程序会显示编译包含路径和链接路径参数

Linker的Standard附加库目录配置为D:\OpenLib\boost_1-66-0\stage\lib

③测试boost库:
新建源文件,输入代码:
#include<iostream>
#include<string>
#include<boost/thread.hpp>
using namespace std;
void mythread()
{
cout << " hello,thread! " << endl;
}
int main()
{
boost::function<void()> f(mythread);
boost::thread t(f);
t.join();
cout << " thread is over! " << endl;
return 0;
}
编译运行,如果输出如下图,说明boost库配置成功。

全部评论 (0)
还没有任何评论哟~
