zoukankan      html  css  js  c++  java
  • boost 1.49在vs 2005下编译的方法

    首先下载boost库,网上自己搜索。

    然后解压到一个目录:如D:oost_1_49_0。然打开vs2005的命令提示符,进行D:oost_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:liblib

    在Include files加上D:libincludeoost-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;
    }
    }

  • 相关阅读:
    php-beanstalkd消息队列类分享
    php curl抓取类分享
    df -i 100%时处理方法
    php生成红包
    PHP牛牛游戏算法
    Yii 框架不同逻辑处理方法统一事务处理
    Linux上web服务器搭建
    Linux 上pcntl安装步骤
    PHP错误级别设置
    day40 ,epoll,数据库相关概念
  • 原文地址:https://www.cnblogs.com/vk83/p/3208853.html
Copyright © 2011-2022 走看看