zoukankan      html  css  js  c++  java
  • 搭建vs2010 boost开发环境

    一、编译boost库

    第一步:下载boost库,下载地址http://sourceforge.net/projects/boost/files/boost/1.55.0/

    第二部:解压boost库,例如解压到F:Third-party libsoostoost_1_55_0

    第三部:开始->程序->MicrosoftVisual Studio 2010->Visual Studio Tools->Visual Studio 命令提示(2010),打开一个控制台

    第四部:cd F:Third-party libsoostoost_1_55_0

    第五部:bootstrap.bat

    第六步:bjam.exe --toolset=msvc-10.0 --build-type=complete

    二、测试环境

    第一步:创建一个工程,附加包含目录为:F:Third-party libsoostoost_1_55_0;附加库目录为:F:Third-party libsoostoost_1_55_0stagelib

    第二部:编写代码测试

    #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下配置成功。

  • 相关阅读:
    httpd添加新模块
    编译httpd细节
    apache配置文件说明及一些指令
    xen原理
    EXSI的使用
    VMWare ESX server安装
    虚拟化技术
    Kvm命令集管理虚拟机
    RAID几种方式
    BZOJ1011 [HNOI2008]遥远的行星 【奇技淫巧】
  • 原文地址:https://www.cnblogs.com/ark-zhang/p/3829707.html
Copyright © 2011-2022 走看看