1.下载boost库

boost官网:www.boost.org,目前最新的版本是1.64,直接下载地址:https://dl.bintray.com/boostorg/release/1.64.0/source/

 

2.安装

解压boost_1_64_0.7z到D:\Program Files (x86)目录下

 

打开VS2010-工具-Visual studio 命令提示,进入D:\Program Files (x86)\boost_1_64_0目录,

VS2010 安装boost库

 

 

执行bootstrap,会生成bjam.exe文件

     再执行指令:bjam toolset=msvc-10.0 variant=debug,release threading=multi link=static,生成boost库(很慢,大概15分钟)

 

    项目右键打开属性页,

    包含目录为:D:\Program Files (x86)\boost_1_64_0

    库目录为:D:\Program Files (x86)\boost_1_64_0\stage\lib

       如下图所示:

VS2010 安装boost库

 

 

 

3.测试

#include <boost/timer.hpp>

#include <iostream>

using namespace boost;
using namespace std;

int main()
{
	timer t;
	std::cout << "max : " << t.elapsed_max() << endl;
	std::cout << "mix : " << t.elapsed_min() << endl;

    std::cout << "now time elapsed: " << t.elapsed() << endl;
	return 1;
}

 

运行结果:

VS2010 安装boost库

 

 

安装成功
 

VS2010 安装boost库

相关文章:

  • 2021-08-27
  • 2017-12-04
  • 2021-11-10
  • 2021-09-28
  • 2021-08-29
  • 2021-10-13
  • 2022-12-23
猜你喜欢
  • 2022-01-17
  • 2022-12-23
  • 2022-12-23
  • 2021-11-18
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案