vs2010配备boost编程环境
来源:互联网 发布:程序员培训夜校 编辑:程序博客网 时间:2024/06/11 08:03
vs2010配备boost编程环境
vs2010配置boost编程环境
第一步:下载boost,我下载的方法是从http://www.boost.org/上找最新的下载。名字叫boost_1_53_0。
第二步:在D盘(最新的boost_1_53_0编译之后大小为5G多)创建一个目录boost,拷贝进去并解压到当前文件夹。(注,这里我没有创建boost目录,直接解压的)
第三步:开始->程序->MicrosoftVisual Studio 2010->Visual Studio Tools->Visual Studio 命令提示(2010),打开一个控制台。
第四步:cd d:\boost\boost_1_53_0
第五步:bootstrap.bat
第六步:(1)b2--toolset=msvc-10.0 --build-type=complete stage或者(2)bjam.exe--toolset=msvc-10.0 --build-type=complete。等待执行完成。
注:我在这里第五步之后会生成了bjam.exe和b2.exe.这里我执行(1)成功,执行(2)失败。
测试:
第一步:创建一个工程,附加包含目录为:d:\boost\boost_1_53_0;附加库目录为:d:\boost\boost_1_53_0\stage\lib。
注:在2010环境下这步,在项目-->右键属性-->VC++ Directories 中去填写对应路径
这两步我的配置的时候是:(1)D:\boost_1_53_0 (2)D:\boost_1_53_0\stage\lib
第二步:编写代码测试。
注:如果编写的测试代码出现类似错误”无法打开包括文件:“boost/regex.hpp”: No such file or directory” 说明附件包含目录出现错误,这时要纠正包含目录。
如果在下还有incude目录,我们只需包含includes目录就加载了相关头文件,如果没有,如上加载总目录,让编译器自己找。
附加:据说在第六步的时候,如果将执行指令里面的“stage”改成”install”,则会生成include指令。
附加测试代码:
C++ Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include<iostream>
#include <boost/regex.hpp>
using namespace std;
int main()
{
// 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);
cout<<"Hello Boost !"<<endl;
}
如果输出结果为:
则表明boost库在vs2010下配置成功。
- vs2010配备boost编程环境
- vs2010配备boost编程环境
- vs2010配备boost编程环境
- vs2010配备boost编程环境
- vs2010配备boost编程环境
- [2]vs2010配备boost编程环境
- vs2010配置boost编程环境
- vs2010配置boost编程环境(照抄并简化)
- VS2010+STLPort+Boost环境搭建
- vs2010设置boost开发环境
- VS2010配置Boost安装环境
- 搭建vs2010 boost开发环境
- 搭建vs2010 boost开发环境
- CC++初学者编程教程(3) 安装VS2010 boost标准库开发环境
- Boost库在VS2010环境中使用
- VS搭建Boost编程环境
- VS2010编程环境常用设置
- boost和STLport在vs2010环境下的编译
- 莫走回头路
- 真正体会到一个ac的快感
- poj 1804求逆序数
- poj 3469 网络流最小割
- poj 1389 线段树面积覆盖
- vs2010配备boost编程环境
- 【我的第一篇技术博文】水一水我的Ubuntu13.04【会有一段时间不定时更新本篇】
- Java中的enum在switch中的一个疑问
- Linux命令rsync的使用(一例)
- android屏幕保持唤醒
- make menuconfig出错解决方法
- win32防止被删日志的非主流保护
- Intent用法简单总结
- Boost库索引