using boost libraries in Code::Blocks IDE

I have to use boost libraries for my C++ codes. I am using Code::Blocks IDE in win 7. I found quite a few information on internet, in boost forum and in codeblocks forum, and finally I make it through by the following steps:

1. Download the zip package from boost.org. Extract the contents to extract_dir. In my case, it is boost_1_48_0.

2. Open Command Prompt (cmd.exe) and go to extract_dir.
cd extract_dir

3. If the minGW\bin folder is not in the path variable, add it.
path minGW_dir\bin;%path%

4. Build the boost build system by entering

bootstrap mingw

5. Open the file extract_dir\project-config.jam in Notepad and change the word msvc to gcc.

6. Back in the Command Prompt window, run

b2

In my case, I have the result :
#######################
...

The following directory should be added to compiler include paths:

D:/boost/boost_1_48_0

The following directory should be added to linker library paths:

D:\boost\boost_1_48_0\stage\lib

########################


7. Setup Code::Blocks Global Variables
a. In Global Variable Editor defined new Variables
i. In Current Set clicked on New button and entered variable name boost
ii. In Current Variable clicked on New button and entered variable name boost
iii. In filed base entered following path: D:/boost/boost_1_48_0
iv. In field lib entered following path: D:\boost\boost_1_48_0\stage\lib

8. Setting Code::Blocks Project Build Options
a. In Project->Build options...
i. Ensured that the overall name of the project is selected in the left-hand column
ii. In Search directories tab Compiler sub-tab filed add $(#boost)
iii. In Search directories tab Linker sub-tab filed add $(#boost.lib)

9. DONE! have fun! :-)

Topic archived. No new replies allowed.