VS2012 下编译boost1.52
来源:互联网 发布:spps怎么实现数据筛选 编辑:程序博客网 时间:2024/04/25 06:21
VS2012 下编译boost1.52
2012-12-25 20:35 by Scott Guthrie Liu, 684 阅读, 1 评论, 收藏, 编辑1. 下载boost_1_52_0.7z
http://sourceforge.net/projects/boost/files/boost/1.52.0/
2. 解压缩到d:\boost目录下
3. 编译bjam
(1)从开始菜单运行“VS2012 开发人员命令提示”
(2)cd到D:\boost\boost_1_52_0下执行bootstrap.bat,然后,会在D:\boost\boost_1_52_0下生成bjam.exe
4.设定编译环境
我的机器上仅安装了VS2012所以未配置
5. 编译boost库
本人使用的bjam命令如下:
bjam stage --toolset=msvc-11.0 --without-graph --without-graph_parallel --without-math --without-mpi --without-python --without-serialization --without-wave --stagedir="D:\boost\boost_1_52_0\bin\vc11" link=static runtime-link=shared runtime-link=static threading=multi debug release
15分钟编译完毕。
关于编译的取舍参考 :http://www.boost.org/doc/libs/1_52_0/more/getting_started/windows.html
The only Boost libraries that must be built separately are:
- Boost.Filesystem
- Boost.GraphParallel
- Boost.IOStreams
- Boost.MPI
- Boost.ProgramOptions
- Boost.Python (see the Boost.Python build documentation before building and installing it)
- Boost.Regex
- Boost.Serialization
- Boost.Signals
- Boost.System
- Boost.Thread
- Boost.Wave
A few libraries have optional separately-compiled binaries:
- Boost.DateTime has a binary component that is only needed if you're using its to_string/from_string or serialization features, or if you're targeting Visual C++ 6.x or Borland.
- Boost.Graph also has a binary component that is only needed if you intend to parse GraphViz files.
- Boost.Math has binary components for the TR1 and C99 cmath functions.
- Boost.Random has a binary component which is only needed if you're using random_device.
- Boost.Test can be used in “header-only” or “separately compiled” mode, although separate compilation is recommended for serious use.
6.设定vs2012环境
用VS 2012新建一个win32控制台应用程序名为Hello。
“属性管理” -> Microsoft.Cpp.Win32.user -> 右键“属性”
在弹出的对话框"C++目录" -> “包含目录”添加 D:\boost\boost_1_52_0
-> “库目录”添加 D:\boost\boost_1_52_0\bin\vc11\lib
通过使用 boost/regex.hpp 简单程序判断配置正确。
#include <boost/timer.hpp>#include <cassert>#include "boost/regex.hpp" using namespace boost;int _tmain(int argc, _TCHAR* argv[]){ cout << "Hello , World !" << endl; timer t; cout << "elapsed_max " << t.elapsed_max() / 3600 << "h" <<endl; cout<< "elapsed_min " << t.elapsed_min() << "s" << endl; cout << "elapsed " << t.elapsed() << "s" <<endl; // 3 digits, a word, any character, 2 digits or "N/A", // a space, then the first word again boost::regex reg("\\d{3}([a-zA-Z]+).(\\d{2}|N/A)\\s\\1"); std::string correct="123Hello N/A Hello"; std::string incorrect="123Hello 12 hello"; assert(boost::regex_match(correct,reg)==true); assert(boost::regex_match(incorrect,reg)==false); return 0;}
主要参考 :
http://www.cnblogs.com/wondering/archive/2009/05/21/boost_setup.html
http://www.cppblog.com/flyinghare/archive/2010/09/07/126078.aspx
http://chenrongya.blog.163.com/blog/static/874741962010102041157963/
- VS2012 下编译boost1.52
- VS2012 下编译boost1.52
- VS2012 下编译boost1.52
- VS2012 下编译boost1.52
- VS2012 下编译boost1.52
- VS2012编译boost1.53
- VS2012编译boost1.53
- VS2012编译boost1.53
- VS2012编译boost1.53
- VS2012编译boost1.53
- VS2012 编译 boost1.53/ boost1.49
- AMGCL--VS2012编译boost1.53
- vs2012+boost1.59+win8.1编译
- cygwin编译boost1.52
- cygwin下编译boost1.45
- CentOS下编译boost1.48.0
- Ubuntu下编译boost1.53
- vs2013下boost1.57编译
- repeater控件介绍、 repeater嵌套的代码实现
- Namenode做block Recovery过程详细剖析
- 十二 Django 1.5.4 外键操作
- Hibernate联合主键详解
- CMFCShellTreeCtrl和CMFCShellListCtrl快速构建资源管理器
- VS2012 下编译boost1.52
- 用一条insert 插入多行数据的方法
- 在一个文件中有 10G 个整数,乱序排列,要求找出中位数。内存限制为 2G。 -- Shirley对比编程珠玑 in<Shirley>
- 那些年干过的事(一)——php电商网站入侵及防护
- Audience Targeting
- CodeIgniter框架出现错误:Message: Cannot modify header information - headers already sent by...
- Testing
- hdu 2190 悼念512汶川大地震遇难同胞——重建希望小学
- Xp系统优化 服务相关命令(6)