Compile and install the boost library in Windows vc6

Source: Internet
Author: User
Tags regex expression
Compile and install the boost library in Windows vc6 Author: Source:Zz Posting time:2007-05-21 Browsing times:

2726 Font Size:Large, medium and small

 

(Zz) first from the boost nest Http://www.boost.org/Download. After the download is complete, it is an installation file (in fact, it is automatically decompressed ). Select your directory to decompress the boost library. Then we start to compile the downloaded version 1.33.1. 1. 2. Enter the directory for installing VC, such as C:/program files/Microsoft Visual Studio/vc98/bin. 3. run vcvars32.bat (this operation is used to register the VC environment variables on this console, so that we can use Cl to compile programs in any directory ). 4. enter the boost directory, for example, C:/boost_33_1/tools/build/jam_src5. modify build. the parameters of the bat script (if necessary, your installation directory is not a C: disk) convert the original parameter if exist "C: /program files/Microsoft Visual Studio/vc98/bin/vcvars32.bat "(
Set boost_jam_toolset = msvc
Set boost_jam_toolset_root = C:/program files/Microsoft Visual Studio/vc98/
Change Goto: EOF) to (that is, the directory where your vc6.0 is installed. Here is an example) If exist "D: /program files/Microsoft Visual Studio/vc98/bin/vcvars32.bat "(
Set boost_jam_toolset = msvc
Set boost_jam_toolset_root = D:/program files/Microsoft Visual Studio/vc98/
Goto: EOF) 6. run D:/D/boost_1_33_1/tools/build/jam_src/build in the console you just opened. bat will eventually generate a bjam.exe executable file in the directory bin.ntx86and copy it to the Directory D:/boost_33_1. to install python, you can Www.python.org8. Set the environment variable set msvc_root = "C:/program files/Microsoft Visual Studio/vc98"
Set VisualC = "C:/program files/Microsoft Visual Studio/vc98"
Set jam_toolset = VisualC
Set python_root = D:/program files/python23
Set python_version = 2.39 start to compile bjam-stools = msvc install (it will be installed in the default directory c:/Boost), so that the compilation is complete 10. in the vc6.0 IDE environment, configure tools> Options> diretories> show diretories for in the following drop-down box:
1) Add the C:/Boost/include/BOOST-1_33_1/Boost directory to include files.
2) Add the C:/Boost/lib directory to library files. 11. Test whether your compilation is successful if you are not sure. Take the regular expression class as an example. Test the following Program # include "stdafx. H"
# Include <cstdlib>
# Include <stdlib. h>
# Include <boost/RegEx. HPP>
# Include <string>
# Include <iostream> using namespace STD;
Using namespace boost; RegEx expression ("^ select ([A-Za-Z] *) from ([A-Za-Z] *)"); int main (INT argc, char * argv [])
{
STD: String in;
Cmatch what;
Cout <"Enter test string" <Endl;
Getline (CIN, In );
If (regex_match (in. c_str (), what, expression ))
{
For (INT I = 0; I <What. Size (); I ++)
Cout <"str:" <what [I]. STR () <Endl;
}
Else
{
Cout <"error input" <Endl;
}
Return 0;
} Input: Select name from database; output: Str: Select name from table
STR: Name
STR: Table
In this way, the Compilation Method of a single library is completed: (taking RegEx as an example) another way to compile boost. RegEx
1. Run vcvars32.bat to help set the VC command line Environment
2. CD boost_000033_1/libs/RegEx/build
3. nmake-vc6.mak

This method can only compile RegEx
At this time, the vc6 directory will be generated under the current directory, which contains compiled lib and DLL files. In this way, you can set the RegEx library to point to this directory in subsequent steps, including the files to the boost_1_33_1 directory.

Additional amendments:
When compiling RegEx with bjam, change vc7 in Option-stools = vc7 to vc71. Otherwise, you need to change the file name (
Libboost_regex-vc7-mt-sgd-1_33_1.lib->
Libboost_regex-vc71-mt-sgd-1_33_1.lib) Comment: According to this method basically successfully compiled library, most of the library compiled successfully, Because I mainly use boost. regEx component. This library is successful and passes the test. The other libraries are not tested. Because I have compiled the 1.34.0 file, the location of the file is different from that described in this article. you only need to modify one of the BAT files if "_ % ProgramFiles % _" = "_" set ProgramFiles = F. How to set the variable: cmd.exe set xxx = yyy. Do you want to enclose YYY in quotation marks for future solutions?

 

 

Related Article

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: info-contact@alibabacloud.com 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.