Open In App

How to Install C++ Boost Libraries on Windows?

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.



 

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

 

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



 

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

 

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

 

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

 

 

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. 




#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*

Article Tags :