S how to compile the boost C ++ library in Windows
Source: Internet
Author: User
Translated from cheungmine, csdn netizen
In WindowsCompile boost C ++LibraryCheungmine2008-6-25 to write out, afraid that I forgot later, also for beginners reference. Use vc8.0 and boost1.35.0.
1) Download boost
Http://www.boost.org/users/download/this is the local download page. Download 2 pictures:
Packaged releasesVersion 1.35.0And
Boost jam 3.1.16You need to find the words details | download under each entry and click Download To Go To The download page. Unfortunately
SourceForgeWebsites are blocked, so you cannot download them. (I cursed the person who blocked the website ). Therefore, it is necessary to use some special tools to penetrate this blocking. I downloaded this: boost_1_35_0.tar.gzand boost-jam-3.1.16.zip.
2) Download python2.5.2
Http://www.python.org/download/click on this page
Python2.5.2 Windows InstallerGet
Python2.5.2.msiClick Install. I installed it in C:/opensource/python25 to create a batch file: PT. BAT, the content is as follows: Set Path = C:/opensource/python25python then start the command line tool (run cmd.exe) and enter PT. bat directory, Type PT. bat if you see the prompt symbol>, it indicates that python is successfully installed.
3) Compile boost-jam
Decompress boost_1_35_0.tar.gz to the boost_1_35_0 directory. My website is in C:/opensource/boost_1_35_0. So you can find the boost-build.jam file under C:/opensource/boost_1_35_0. Decompress boost-jam-3.1.16.zip, and then double-click build. bat under the directory to compile. After compilation, bin. ntx86/bjam.exe is generated. We want to copy this bjam.exe to the boost_1_35_0 directory where there is a boost-build.jam file.
4) Fully compiled boost_1_35_0
Compile all databases. Although you can only compile a part of it, it is still necessary to compile all of it, saving you trouble in the future. To solve this problem, you need to write a batch processing file. I name it boost. BAT: Set msvc_root = "F:/Microsoft Visual Studio 8/VC" set VisualC = "F:/Microsoft Visual Studio 8/VC" set jam_toolset = visualcset python_root = C: /opensource/python25set python_version = 2.5.2set Path = C:/opensource/boost_1_35_0 ensure that your path is set correctly. Then save the file to C:/opensource. (In fact, the location is not important ). Then enable the command line tool (CMD ). Similarly, enter the following command (<enter> enter): C:/opensource>
Boost. bat<Enter> C:/opensource>
CD boost_000035_0<Enter> C:/opensource/boost_1_35_0>
Bjam-sboost_root =.-stools = msvc<Enter> wait. Don't worry about a lot of warnings. It is estimated that the compilation will be completed in less than one hour. You can find the following occurs on drive C:
C:/BoostIt contains the include and Lib directories. You can use this c:/boost to use its static or dynamic library. You can also use
C:/opensource/boost_000035_0Source code.
5) The end is also the start of boostJourney
Now, let's start your boost journey. I used its graph library to implement the shortest path. The whole road network in Shanghai, with more than 40 thousand road sections, can query the shortest path at any 2 points, no more than 3 seconds. The memory consumption is about 30 mb. Since then, I like boost. The latest boost provides C ++ and Python interfaces, which is why I want to use it. A simple analogy: C ++ is like COM and python is like JavaScript. If you think JavaScript calls to com can generate powerful power, it is an atomic bomb, then Python calls C ++, which is a hydrogen bomb. For more information about boost. Python, see: http://www.cppblog.com/jinq0123/archive/2008/05/29/BuildingHybridSystemswithBoostPython_c.html
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.