编译并使用Boost库(Win7+Boost1.53+VS2012)
来源:互联网 发布:中国闪存技术知乎 编辑:程序博客网 时间:2024/05/18 16:55
1、下载boost库
从http://www.boost.org上下载到目前最新的boost库,快速传送门:boost_1_53_0.zip,当然你也可以从http://sourceforge.net/projects/boost/files/boost-jam/这里得到源代码,快速传送门:boost_1_53_0.zip(98.1 MB)
我使用了后者
Boost程序库完全开发指南——深入C++“准”标准库高清PDF版 http://www.linuxidc.com/Linux/2013-07/87574.htm
Ubuntu下编译安装boost库 http://www.linuxidc.com/Linux/2013-07/87573.htm
Ubuntu下编译boost 1.52b http://www.linuxidc.com/Linux/2013-02/79004.htm
Ubuntu编译安装boost并在eclipse C/C++中使用 http://www.linuxidc.com/Linux/2011-04/34790.htm
2、得到源代码之后,使用vs2012的cl.exe编译
进入到源代码目录中
3、建立编译工具bjam.exe----需要执行bootstrap.bat
4、指定编译命令
指定msvc版本11.0对应的是vs2012,--stagedir是指定编译后存放的目录
bjam stage --toolset=msvc-11.0 --without-graph --without-graph_parallel --without-math --without-mpi --without-python --without-serialization --without-wave --stagedir="F:\boost\boost_1_53_0\bin\vc11" link=static runtime-link=shared runtime-link=static threading=multi debug release
稍微等一会,库就编译好了……
5、开始使用boost
首先需要设定文件包含目录:
我的boost库解压在F盘下
设定库目录:
“F:\boost\boost_1_53_0\”是我编译的出来lib的目录
然后建立我们的第一个boost项目,代码如下:
#include "stdafx.h"
#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;
}
6.这是输出:
- 编译并使用boost库(win7+boost1.53+vs2012)
- 编译并使用Boost库(Win7+Boost1.53+VS2012)
- 编译并使用Boost库(Win7+Boost1.53+VS2012)
- 编译使用boost库(win7+boost1.53+vs2012)
- 编译并使用boost库(win7+boost1.60+vs2013)
- 编译并使用boost库(win7+boost1.60+vs2013)
- 编译并使用boost库(win7+boost1.63+vs2015+32位or 64位)
- 编译并使用boost库(win7+boost1.63+vs2015+32位or 64位)
- VS2012编译boost1.53
- VS2012编译boost1.53
- VS2012编译boost1.53
- VS2012编译boost1.53
- VS2012编译boost1.53
- VS2012 编译 boost1.53/ boost1.49
- AMGCL--VS2012编译boost1.53
- win7+vs2010 + vs2012自动下载boost并编译安装
- win7 vs2012 编译boost 1.55
- win7下vs2012编译boost
- 字符串反转,但单词不倒置
- 杭电acm 1009 FatMouse' Trade 比较典型的贪心问题
- 71. Simplify Path
- objective C程序 内存管理
- 2015年8月2日工作日志--------赵鑫
- 编译并使用Boost库(Win7+Boost1.53+VS2012)
- 移植u-boot-2015.07-rc3之修改代码支持DM9000网卡(七)
- Ubuntu Kylin15.04 DVD .VOB 格式文件播放
- 求一个字符串中【连续】出现次数最多的子串
- OC相关-02:oc和c的基本差异
- mysql常用命令
- nod1189 阶乘能拆的和
- 一次使用Eclipse Memory Analyzer分析Tomcat内存溢出
- Linux学习-ps aux指令