Boost Download and installation (Windows edition)

Source: Internet
Author: User
Tags visual studio 2010

1 Introduction

Boost is a quasi-C + + standard library, equivalent to the continuation and expansion of STL, its design concept and STL are relatively close to the use of generics to maximize reuse. Boost includes several broad categories: string and text processing, containers, iterators (iterator), algorithms, function objects and higher-order programming, generic programming, template meta-programming, preprocessing meta-programming, concurrent programming, mathematical correlation, error correction and testing, data structures, input/output, cross-language support, Memory-related, parsing, miscellaneous .

2 Boost Download and installation

We can download the latest boost version on the Boost website. Since the boost library can be run on multiple platforms like the standard library, it is officially available as source code only. For Windows users, we often want to directly download an installation component directly instead of compiling it ourselves, we can download the corresponding installation component directly on this website, we will use this website as an example to introduce the installation component download.

1. Open the website and its interface is shown below:

2. The current stable version is 1.63 so here I download version 1.63. The open source software that is generally being updated will have a current version and a stable version, if we are not developing it, choose the stable version. After selecting *1.63.0*, we can see the following list of files:

3. We can see that there are many installation files here. This is because the installed version of boost Windows is related not only to the number of processor bits, but also to the version of Visio Studio . Here we first download the dependency_versions.txt file and review, you can find a section of the following:

Microsoft Visual Studio 2005-msvc-8.0-service Pack 1
Microsoft Visual Studio 2008-msvc-9.0-service Pack 1
Microsoft Visual Studio 2010-msvc-10.0-service Pack 1
Microsoft Visual Studio 2012-msvc-11.0-update 4
Microsoft Visual Studio 2013-msvc-12.0-update 3

4. For example, here we are using VS2012. Then we should download it boost_1_63_0-msvc-11.0-64.exe or boost_1_63_0-msvc-11.0-32.exe . After the download is complete, follow the steps to install it.

3 Use of Boost

The use of boost is of course the first recommendation of official documentation. Of course, you can also refer to the main reference post mentioned later in this article. The following is an example of the initial download of the source file version of boost for a brief introduction to some official website of the introductory routine. This routine can also be found in the index.html in the Boost folder.

1. First create a new empty C + + project in Visio Studio, where the project name is named boostTest , and then add a source file that contains the following:

#include <boost/lambda/lambda.hpp>#include <iostream>#include <iterator>#include <algorithm>intMain(){Using namespace boost::Lambda;    typedefStd::Istream_iterator<Int>Inch;Std::For_each(Inch(Std::Cin),Inch(),Std::cout << (_1* 3) << " " );}

2. After the completion of the project, we need to add the corresponding header file search path, the specific steps are as follows:

* Select our project in Solution Explorer ( boostTest ), right click on the pop-up menu 属性(R) , or use the shortcut key to bring up the Alt+Enter Properties dialog box.

* In the left panel of the dialog box 配置属性→C/C++→常规 , select, add our Boost directory in the right panel, 附加包含目录 as shown (this is configured in VS2015 for example, other versions of the VS display may be slightly different):

* Then select the left panel 配置属性→C/C++→预编译头 , in the right panel will 预编译头 be set to 不适用预编译头 (default) as shown in:

* After the configuration is complete, we can compile ( Ctrl+Shift+B ) and run ( F5 ) Our program, if there is an error can be re-check the configuration process or view the index.html in the Boost folder corresponding chapters. The result of the operation is as follows ( 1 2 3 return the corresponding X2 result in console input):

The main reference posts in this article :
Introduction to C + + Boost Library
Primary knowledge boost C + +

Boost Download and installation (Windows edition)

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.