vs2005下安装boost
来源:互联网 发布:java类获取request 编辑:程序博客网 时间:2024/04/28 20:34
vs2005下安装boost
2007-10-17 10:21
网上有很多安装方法,以下是我成功安装的步骤
1.下载boost_1_34_1压缩文件,解压缩到d:/boost_1_34_1/目录下
2.编译bjam
从vs2005的工具菜单进入命令提示窗口(一定要从这进),cd到d:/boost_1_34_1/tools/jam/src下执行build.bat,会在d:/boost_1_34_1/tools/jam/src/bin.ntx86/產生bjam.exe,將bjam.exe複製到d:/boost_1_34_1/下。
3.设定编译环境
修改user-config.jam (d:/boost_1_34_1/tools/build/v2/user-config.jam) 的MSVC configuration
# MSVC configuration
# Configure msvc (default version, searched in standard location
# and PATH).
# using msvc ;
using msvc : 8.0 : : <compileflags>/wd4819 <compileflags>/D_CRT_SECURE_NO_DEPRECATE <compileflags>/D_SCL_SECURE_NO_DEPRECATE <compileflags>/D_SECURE_SCL=0 ;
# Configure msvc (default version, searched in standard location
# and PATH).
# using msvc ;
using msvc : 8.0 : : <compileflags>/wd4819 <compileflags>/D_CRT_SECURE_NO_DEPRECATE <compileflags>/D_SCL_SECURE_NO_DEPRECATE <compileflags>/D_SECURE_SCL=0 ;
4.编译boost
將目錄移至d:/boost_1_34_1/下執行參數說明
--without-python 表示不使用 python
--toolset : 所使用compiler,Visual Studio 2005為msvc-8.0
--prefix:指定編譯後library的安裝目錄
这一步要花很长时间(大约50分钟)
5.设定vs2005环境
Tools -> Options -> Projects and Solutions -> VC++ Directories
在Library files加上d:/boost/lib
在Include files加上d:/boost/include/boost-1_34_1
在Library files加上d:/boost/lib
在Include files加上d:/boost/include/boost-1_34_1
6.测试安装是否成功
#include <iostream>
#include <string>
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string_regex.hpp>
#include <string>
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string_regex.hpp>
using namespace std;
using namespace boost;
using namespace boost;
int main() {
string s = " Hello boost!! ";
trim(s);
cout << s << endl;
getchar();
std::string regstr = "a+";
boost::regex expression(regstr);
std::string testString = "aaa";
string s = " Hello boost!! ";
trim(s);
cout << s << endl;
getchar();
std::string regstr = "a+";
boost::regex expression(regstr);
std::string testString = "aaa";
// 匹配至少一个a
if( boost::regex_match(testString, expression) )
{
std::cout<< "Match" << std::endl;
}
else
{
std::cout<< "Not Match" << std::endl;
}
if( boost::regex_match(testString, expression) )
{
std::cout<< "Match" << std::endl;
}
else
{
std::cout<< "Not Match" << std::endl;
}
}
输出结果:
- vs2005下安装boost
- vs2005下安装boost
- VS2005下安装boost
- vs2005下安装boost(转帖)
- VS2005 下使用BOOST
- vs2005中安装boost
- vs2005中安装boost
- VS2005下boost库的详细安装过程
- vs2005下安装boost::regex 及简单的使用(转)
- VS2005下编译boost库
- VS2005下编译boost库
- 在VS2005中安装Boost
- 在VS2005中安装Boost
- vs2005下 使用boost::regex 和 filesystem
- VS2005下编译boost.regex1.48.0
- boost在VS2005下的使用
- 在vs2005中安装boost库
- 在vs2005中安装boost库
- SQL Server 2005中的文件和文件组
- 我是新来的
- 【转】grep正则表达式
- Linux应用程序开发
- PowerShell笔记(三):调用MS SQL数据库
- vs2005下安装boost
- 设备内容(API)
- 谈谈我的寝室,此话题有点沉重,我只想说说事实
- 出现SQL insert, update or delete failed (row not found)错误,原因总结:
- mysql 查看索引使用情况
- 利用Visual Studio 2008 GDI+实现的txt小说阅读器
- 经典批处理教程
- mysql索引的一个技巧
- Javascript中最常用的55个经典技巧