1. Compile the boost Library
Step 1: Download boost library, http://sourceforge.net/projects/boost/files/boost/1.55.0/
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.