vs2010配备boost编程环境
来源:互联网 发布:五轴加工中心编程软件 编辑:程序博客网 时间:2024/04/30 14:57
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环境下的编译
- 自动点击弹出框的“取消”按钮(初始化磁盘时,会弹出这样的窗口)
- 基于WOSA/XFS标准的金融开发
- OC 分类
- 非递归排序
- oracle用户创建及权限设置
- vs2010配备boost编程环境
- leetcode:Gas Station
- 大话数据结构学习笔记(四)
- Android按键事件处理流程 KeyEvent
- jQuery 之ajax jsonp跨域请求学习笔记
- 手机中执行top命令
- java发送email错误(454 Authentication failed, please open smtp flag first!)
- Android中按键消息的派发过程及源码分析
- Couldn't load BaiduMapSDK_v3_1_0: findLibrary returned null