编译并使用boost库(win7+boost1.63+vs2015+32位or 64位)
来源:互联网 发布:ktv网络维护 编辑:程序博客网 时间:2024/05/17 05:11
首先下载得到boost的最新版(目前最新版是1.63)
下载地址:
http://www.boost.org
也可以从这里直接下载
http://download.csdn.net/detail/zengraoli/9815337
下载完成后解压出来
编译32位的boost库
打开vs的32位命令行工具
进入到boost源代码文件夹中
进入到boost源代码文件夹中
运行bootstrap.bat
执行如下操作,对boost进行编译
(msvc版本14.0对应的是vs2015,--stagedir是指定编译后存放的目录,文章附录有vs版本对应编号)
- bjam stage --toolset=msvc-14.0 --without-graph --without-graph_parallel --stagedir="D:\boost\boost_1_63_0\bin\vc14" link=static runtime-link=shared runtime-link=static threading=multi debug release
这样得到的是就是32位的boot库
编译64位的boost库
打开vs的64位命令行工具
进入到boost源代码文件夹中
运行bootstrap.bat
执行如下操作,对boost进行编译
(msvc版本14.0对应的是vs2015,--stagedir是指定编译后存放的目录)
- bjam stage --toolset=msvc-14.0 architecture=x86 address-model=64 --without-graph --without-graph_parallel --stagedir="D:\boost\boost_1_63_0\bin\vc14-x64" link=static runtime-link=shared runtime-link=static threading=multi debug release
这样得到的是就是64位的boot库
开始使用boost
设置测试的程序为64位
设置附加的包含路径(下载之后解压的boost文件夹):
设定库路径:
然后建立第一个boost项目,代码如下:
- #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;
- }
得到输出
附录
附上版本对应编号
- VC6
- VC7(2003)
- VC8(2005)
- VC9(2008)
- VC10(2010)
- VC11(2012)
- VC12(2013)
一个boost线程池的例子
附带一个boost使用线程池的例子
http://blog.csdn.net/zengraoli/article/details/70187693
阅读全文
0 0
- 编译并使用boost库(win7+boost1.63+vs2015+32位or 64位)
- 编译并使用boost库(win7+boost1.63+vs2015+32位or 64位)
- 编译并使用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)
- Windows下VS2015编译64位Boost1.64
- vs2013编译boost1.55.0 32/64位
- 编译使用boost库(win7+boost1.53+vs2012)
- VS2015配置32位boost库
- 【Boost库初探】Boost.Regex库编译、使用(32位/64位)
- win7 64编译64位boost
- win7 64编译64位boost
- win7 64编译64位boost
- 【VS开发】【C/C++开发】vs2015编译boost 64位
- boost 库编译64位
- win7 vs2015环境 GDAL2.0.1 64位 编译解决
- 多校10_1010 hdu6180 贪心+STL:multiset
- java面试题<1>
- 【Linux学习笔记】11:其它帮助命令
- 2017 多校训练第十场 HDU 6178 Monkeys 最小点覆盖+树形DP
- Python学习笔记 1
- 编译并使用boost库(win7+boost1.63+vs2015+32位or 64位)
- struts2和spring框架的整合
- Python(一)
- 最小生成树
- openjudge-4105-拯救公主-(bfs+)
- Python依赖打包发布详细
- 传统美容美发店铺如何借力互联网,卓美业网拓系统悄然内测
- Java中对Array数组的常用操作
- DirectFB学习之添加gfx驱动