Install the boost library on Windows

Source: Internet
Author: User

Reproduced http://blog.csdn.net/isilent/article/details/7400359

1. Download boost

SlaveHttp://www.boost.org/DownloadBoostLibrary. The current version is1.52

Boost_000052_0 \................. the "Boost root directory" index.htm ......... A copy of www.boost.org starts here boost \......................... all boost header files libs \............ tests ,. CPPS, Docs, Etc ., by library index.html ........ library documentation starts here algorithm \ any \ array \... More libraries... Status \......................... boost-wide test suite tools \........... utilities, e.g. boost. build, quickbook, BCP more \.......................... policy documents, etc. doc \............... A subset of all boost library docs


2. Compile

Some libraries of Boost are composed of HPP files, so they can be referenced directly without compilation. However, some of them need to be compiled into binaryCodeFor future convenience, we can compile it all first.

1. RunBootstrap.bat. bjam.exe will be generated after completion.

2. RunBjam.exe,

Bjam.exe -- toolset = msvc-9.0 -- link = static -- runtime-link = shared -- threading = multi -- without-Python stage debug release

In this case, you should consider whether to fully compile based on your own needs. If it is fully compiled, simply execute the commandBjam -- toolset = msvc-9.0 -- Build-type = complete.(Vc2010 is used here)


3. Add boost to the code library. The boost directory is the header file, and the stage \ Lib is the static Link Library. Copy it to the code library as needed. If it is only used on the local machine, you can also directly set the include and additional library directories in. , Output code
 
# Include <boost/Timer. HPP> # include <iostream> using namespace boost; using namespace STD; int main () {timer t; cout <t. elapsed_max ()/3600 <"H" <Endl; getchar (); Return 0 ;}

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.