Build the vs2010 boost development environment

Source: Internet
Author: User

1. Compile the boost Library

Step 1: Download boost library,

Part 2: Decompress the boost library, for example, decompress it to F: \ third-party libs \ boost \ boost_000055_0

Third part: Start-> Program-> microsoftvisual studio 2010-> Visual Studio Tools-> Visual Studio command prompt (2010), open a console

Part 4: cd f: \ third-party libs \ boost \ boost_000055_0

Part 5: Bootstrap. bat

Step 6: bjam.exe -- toolset = msvc-10.0 -- Build-type = complete


Ii. Test Environment

Step 1: Create a project and add the following directory to the project: F: \ third-party libs \ boost \ boost_1_55_0. The directory of the additional library is F: \ third-party libs \ boost \ boost_rj55_0 \ stage \ Lib

Part 2: write code for testing

#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;}

Part 3: Compile and run the program. If the output result is:

It indicates that the boost library is successfully configured under vs2010.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.