RegEx library Installation Summary
After learning regular expressions, I am eager to implement some functions through programming. I learned from the Internet that the boost. RegEx Library provides what I want. It is no exaggeration to say that I have been happy for several days because I know the boost library...
So, to get started, you have to do some trouble to use the boost library instead of an include. In fact, after you complete the installation, you will find it easy.
The official RegEx library installation steps are provided. Although I have not succeeded in following these steps, the official steps should not be problematic. It may be due to the problem of setting the directory of the dependent library.
Web: http://www.boost.org/doc/libs/1_49_0/libs/regex/doc/html/boost_regex/install.html
Find microsoftvisual C ++ 6, 7, 7.1 and 8, which is quite detailed.
The following are my operations for your reference:
1)Download:
Download boost from www.boost.org (my downloaded version is boost_000049_0)
2)Extract:
The decompressed directory is officially available, but for convenience, I directly decompress it to drive C (directory: C: \ boost_000049_0. If your directory is different from mine, the following steps also need to be changed to the directory you saved)
Note: Steps 3) and 4) are completed in the Visual Studio command prompt box.
Command Prompt box (vs2008): Start-> All Programs-> Microsoft Visual Studio 2008-> Visual Studio Tools-> Visual Studio 2008 Command Prompt
3) generate bjam:
1. Enter cd c: \ boost_000049_0 in the command prompt box.
2. Enter Bootstrap. bat in the command prompt box.
3. Check the directory cd c: \ boost_000049_0. If it is correct, three more things are provided: b2.exe,bjam.exe, bootstrap. Log
4) Libraries required for compilation
Note: This step varies from person to person. Check the number of libraries you need to use in boost. If you are in trouble, compile all the libraries (enter bjam.exe in the command prompt box ). It takes about one hour (for coffee ).
My method is to compile a specific Library
1,In the command prompt box, enter:Bjam -- toolset = msvc -- With-regexstage (just be patient)
2. Check the directory cd c: \ boost_000049_0. If it is correct, add the following two directories: bin. V2 and stage.
3. view the directory c: \ boost_000049_0 \ stage \ Lib: correct, there are two Lib: libboost_regex-vc90-mt-1_49.lib and libboost_regex-vc90-mt-gd-1_49.lib
5) Set "include directory" and "library (LIB) directory"
Note: This step is actually very simple, but it has plagued me for as many as two hours.
A similar error occurs in the program that compiles your own reference RegEx Library: Fatal error c1083: Unable to open the include file: "Boost \ RegEx. HPP ": no such file or directory is caused by this step, and I have always doubted what went wrong when compiling the RegEx library...
Specific settings (provided that you have created a "Win32 console application" project under vs2008)
1. Set the include dependency Directory: Project-> "project name" Attribute-> C ++-> General-> Add the include directory, and enter c: \ boost_1_49_0 in the directory.
2. Set the Lib dependency Directory: Project-> "project name" properties-> connector-> General-> additional library directory, and copy the directory c: \ boost_1_49_0 \ stage \ Lib here
6) write a program and try again.
The simplest way to write a sentence # include
<Boost/RegEx. HPP>: After compilation, you will be able to pull it. Haha