![]() Select “Project->Build Project”.ħ.)Your first boost program is ready to run. Press “OK” and again “OK” on Properties window.Ħ.)Before you can run the program and see the output, you have to build the code first. Specify the path where you have extracted boost. Give a project name and click “Finish”.Ģ.) Go to Project Explorer, Open YourProjectName.cpp, for this example open, BoostExample->src->BoostExample.cppģ.) This file already has some code, which you can delete and type the following code which shows us the version of boost:-Ĭout Properties), select C/C++ Build->Settingsĥ.) In the settings pane, select “Includes” under GCC C++ Compiler and click on the icon with plus sign on it(Add.). I will show how to use both types of libraries in a C++ program.ġ.) Create a new C++ project in eclipse, select “File->New->C++ Project”. Tar –bzip2 -xf /media/Data/downloads/boost_1_48_0.tar.bz2īoost Libraries are divided into two categories, header-only libraries(no need to build) and libraries which require separate build. ![]() Tar –bzip2 -xf / /boost_1_48_0.tar.bz2įor 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:. Download boost_ 2 file.Ģ.)Execute the following command in the directory where you want to put boost installation:. This guide believes that you already have downloaded, installed and setup Eclipse for C++ in your computer(if not, download from here).ġ.) Download the latest version(1.48.0 at the time of this writing) of boost library from here. 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.īoost 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).
0 Comments
Leave a Reply. |