vs2015 编译boost库

由于用到相机同步,就安装了boost库 下面说一下安装方法:

1、下载boost官网安装包。

https://dl.bintray.com/boostorg/release/1.66.0/binaries/

注意:这里一定要选择好boost版本 

 如:  boost_1_66_0-msvc-14.0-64.exe      14.0对应vs2015   64:64位

2、下载后解压。

3、找到   开始->所有程序->visual studio 2015  ->vs2015 x64 本机工具命令提示符   打开。

4、cd到解压的目录,运行  .\bootstrap.bat; 等待 在该目录下会生成 bjam.exe

5、接着输入

bjam stage --toolset=msvc-14.0 architecture=x86 address-model=64 --without-graph --without-graph_parallel --stagedir="你自己的路径\boost_1_66_0\newbuild" link=static runtime-link=shared runtime-link=static threading=multi debug release 

注意:你自己的路径\boost_1_66_0\newbuild是自定义的目录,此目录存放编译成功的静态库。

漫长的编译过程。。。。。。。

6、配置boost库:

要将解决方案平台改成x64

vs2015 新建项目。然后该项目的属性页:c/c++  常规  附加包含目录:设置为:你自己的路径\boost_1_66_0;

然后  链接器  常规   附加库目录 设置为  你自己的路径\boost_1_66_0\newbuild\lib;

7、测试

  1. #include "stdafx.h"  
  2. #include<iostream>  
  3. #include<string>  
  4.   
  5. #include<boost/thread.hpp>  
  6.     using namespace std;  
  7.   
  8.     void mythread()  
  9.     {  
  10.         cout << " hello,thread! " << endl;  
  11.     }  
  12.       
  13.     int main()  
  14.     {  
  15.         boost::function<void()> f(mythread);  
  16.         boost::thread t(f);  
  17.         t.join();  
  18.         cout << " thread is over! " << endl;  
  19.       
  20.         return 0;  
  21.     }  

若运行成功,则说明已经安装好了(类似opencv3的安装配置)。


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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值