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

  • 相关阅读:
    o9.17,习题
    09.17,二维数组,地图
    09.15,一维数组,冒泡排序
    09.11 小兔 成兔问题
    09.01,学习习题
    FTPHelper
    Wpf发送接收 win32消息
    win32Helper
    xml 封装类
    C# 多进程安全
  • 原文地址:https://www.cnblogs.com/ark-zhang/p/3829707.html
Copyright © 2011-2022 走看看