boost 1.49在vs 2005下编译的方法
2013-07-23 16:40
253 查看
首先下载boost库,网上自己搜索。
然后解压到一个目录:如D:\boost_1_49_0。然打开vs2005的命令提示符,进行D:\boost_1_49_0目录:
1.运行bootstrap.bat。
2.运行如下命令:b2 install --prefix=库文件的目录(如:d:\lib) --toolset=msvc-8.0 --without-python。
如:b2 install --prefix=d:\lib --toolset=msvc-8.0 --without-python
大概运行40分钟左右,根据机器速度而来。
设定vs2005环境
Tools -> Options -> Projects and Solutions -> VC++ Directories
在Library files加上D:\lib\lib
在Include files加上D:\lib\include\boost-1_49
测试程序:
#include <iostream>
#include <string>
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string_regex.hpp>
using namespace std;
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";
// 匹配至少一个a
if( boost::regex_match(testString, expression) )
{
std::cout<< "Match" << std::endl;
}
else
{
std::cout<< "Not Match" << std::endl;
}
}
然后解压到一个目录:如D:\boost_1_49_0。然打开vs2005的命令提示符,进行D:\boost_1_49_0目录:
1.运行bootstrap.bat。
2.运行如下命令:b2 install --prefix=库文件的目录(如:d:\lib) --toolset=msvc-8.0 --without-python。
如:b2 install --prefix=d:\lib --toolset=msvc-8.0 --without-python
大概运行40分钟左右,根据机器速度而来。
设定vs2005环境
Tools -> Options -> Projects and Solutions -> VC++ Directories
在Library files加上D:\lib\lib
在Include files加上D:\lib\include\boost-1_49
测试程序:
#include <iostream>
#include <string>
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string_regex.hpp>
using namespace std;
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";
// 匹配至少一个a
if( boost::regex_match(testString, expression) )
{
std::cout<< "Match" << std::endl;
}
else
{
std::cout<< "Not Match" << std::endl;
}
}
相关文章推荐
- VS 2005 编译的程序不能运行的几个解决方法
- VS 2005 编译的程序不能运行的几个解决方法
- VS 2005 编译的程序不能运行的几个解决方法
- VS2005下编译boost.regex1.48.0
- boost 1.42.0 在vs 2005 下安装过程(增加boost 1.55.0在vs2008下编译过程)
- VS 2005 编译的程序不能运行的几个解决方法
- WCE+ARM+TCPMP VS2005之旅:ASM编译添加规则的方法
- vs 2005编译boost
- vs 2005编译boost
- boost.asio openssl zlib protobuf icu vs2015编译
- cxIMage在VS 2005下的编译和使用
- VS2013编译boost1.56.0
- VS 2005中调试JavaScript的方法
- vs 2005 qt下编译 MYsql 驱动
- vs2005环境下CELayoutEditor源码编译详细步骤
- win7 vs2012 编译boost 1.55
- vs2010打包系统必备选择.net framework 3.5sp1编译错误的解决方法
- 编译boost asio http/server 方法
- VS编译链接时错误(Error Link2005)的解决方法
- 利用VS 2005调试 JAVASCRIPT的两种方法