How to use Boost library with Eclipse on Ubuntu

I was trying to use the multi-threading capability of boost C++ library, but found that there is no comprehensive(and appropriately brief) guide which shows how to use this library with Eclipse on Ubuntu, so I decided to write one myself.

Boost is a set of widely used cross platform C++ libraries which provide a lot of functionalities which are required by most of medium-large sized applications like multi-threading and regular expressions, but unfortunately are not available natively in C++(although some of these will be available in C++11).
This guide believes that you already have downloaded, installed and setup Eclipse for C++ in your computer(if not, download from here).

1.) Download the latest version(1.48.0 at the time of this writing) of boost library from here. Download boost_version.tar.bz2 file.
2.)Execute the following command in the directory where you want to put boost installation:-
tar –bzip2 -xf /[path_to_tar]/boost_1_48_0.tar.bz2
For example, if you stored “boost_1_48_0.tar.bz2” in “/media/Data/downloads” and want to put the installation in “/media/Installation” then go to “/media/installation” and execute:-
tar –bzip2 -xf /media/Data/downloads/boost_1_48_0.tar.bz2

Continue reading “How to use Boost library with Eclipse on Ubuntu”