boos 1.67

目录

1.下载

2.得到源代码之后,使用vs2017的cl.exe编译

3.建立编译工具

4.指定编译命令(最费时间)

5.开始使用boost


1.下载

http://www.boost.org上下载到目前最新的boost库:https://www.boost.org/users/history/version_1_67_0.html中的boost_1_67_0.zip

2.得到源代码之后,使用vs2017的cl.exe编译

 

 

3.建立编译工具

1)进入下载的boost目录下: 

cd \d D:\ThirdPart\boost_1_67_0

2) 执行脚本:bootstrap.bat

等待一分钟后本目录下生成b2.exe和bjam.exe则便表示生成成功

 

4.指定编译命令(最费时间)

 

指定msvc版本14.1(不清楚的查一下)对应的是vs2017,--stagedir是指定编译后存放的目录

bjam stage --toolset=msvc-14.1 --without-graph --without-graph_parallel --stagedir="D:\ThirdPart\boost_1_67_0\bin\vc14" link=static runtime-link=shared runtime-link=static threading=multi debug release

 

5.开始使用boost

首先需要设定文件包含目录:

我的boost库解压在D盘下

 

设定库目录:

 

然后建立我们的第一个boost项目,代码如下:

  1.  

    #include "boost/thread.hpp"
    
    #include "iostream"
    
    using namespace std;
    
    
    
    void mythread()
    
    {
    
    cout << " hello,thread! " << endl;
    
    }
    
    
    
    int _tmain(int argc, _TCHAR* argv[])
    
    {
    
    boost::function<void()> f(mythread);
    
    boost::thread t(f);
    
    t.join();
    
    cout << " thread is over! " << endl;
    
    
    
    return 0;
    
    }

     

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值