Open In App

How to Install C++ Boost Libraries on Windows?

Improve
Improve
Like Article
Like
Save
Share
Report

Boost library is a set of a popular collection of peer-reviewed, free, open-source C++ libraries. It supports a number of tasks such as unit testing, image processing, multithreading, and mathematical aspects such as linear algebra and regular expressions. You can also store, numbers that are out of range of long long, or double. It was first made available on September 1st, 1999. There are 164 different libraries in it. In this article, we will learn, how to install the boost library in C++ on Windows. 

Installing Boost Library in C++ on Windows:

Step 1: Go to Boost.org. Click on the Downloads option on the right side.

go to boost.org

 

Step 2: Click on the boost_1_72_0.zip file, to download the required boost library. It has an approx. size of 200MB

download the boost zip to install boost library in c++

 

Step 3: Now, open the location where your zip file is downloaded. For example: This PC > Local Disk (C:) > Users > jh > Downloads >

open folder location of the boost library.

 

Step 4: Select the zip file. Right-Click on it, and select Extract All… 

extract the zip file at the same location

 

Step 5: The files get extracted at the same location, with the same folder name. Now, go to Program Files, and create a new folder name Boost

create a new folder name boost in program files

 

Step 6: Now, copy the extracted folder boost_1_72_0 into the boost folder. Hence, the boost library is installed into our system. 

copy, the extracted folder into the boost folder.

 

wait for the folder to move into boost folder, and the installation of the boost library is completed.

 

Verify the Installation of the Boost Library in C++ 

The successful compilation of the code will prove that the boost library is installed in windows. 

C++




#include <boost/array.hpp>
#include <iostream>
    
using namespace std;
int main()
{
    boost::array<int, 10> arr
        = { { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 } };
    for (int i = 0; i < 10; i++) {
        cout << "Geek Rank is :" << arr[i] << "*"
             << "\n";
    }
    return 0;
}


Output:

Geek Rank is :1*
Geek Rank is :2*
Geek Rank is :3*
Geek Rank is :4*
Geek Rank is :5*
Geek Rank is :6*
Geek Rank is :7*
Geek Rank is :8*
Geek Rank is :9*
Geek Rank is :10*


Last Updated : 16 Oct, 2022
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads