I just want to share the mistakes I did linking Boost 1_51_0 with Codeblocks10.05+MiniGW(gcc) and lost therefore 20 hours the recent days.
To Build Boost 1_51_0 under Windows see this guide under section 5.3:http://www.boost.org/doc/libs/1_51_0/more/getting_started/windows.html
If you use gcc like me don't forget to mention it to the commands like "bootstrap.bat gcc" or with the "toolset" command.
Above 3 lines look short, but if you are new to it, like I was, it will take you some hours. The building of Boost itself will take at least 20 minutes.
Now link Boost to Codeblocks, you will find lots of information via google, but lots of it is crap and/or old.
First the global Variables.
You will find the dialog above under Settings->Global Variables...
Basically you tell codeblocks whenever there is #boost it is actually the path "C:\Programmieren\boost_1_51_0" in my case.
And #boost.lib is "C:\Programmieren\boost_1_51_0\stage\lib". I had some trouble with #boost.include, if you got the point how it works you can decide yourself if you want to write something there or leave the field blank.
Now you use the Global Variable "#boost" to tell codeblocks the path for compiling and linking.
You find this dialog like this. Right-click on your project->Build options... Now click on the root of your project, e.g. neither click on debug nor on release. Select "Search directories" and then "Compiler" tab. Here you tell the path of your header files. What to write here depends on what you have written as global variables and what you will write in your projects. For example you have "#include <boost\regex.hpp>" in your *.cpp file then you will have to write $(#boost) in the compiler tab. Because $(#boost) is "C:\Programmieren\boost_1_51_0" and when you include "boost\regex.hpp" it will be the path "C:\Programmieren\boost_1_51_0\boost\regex.hpp" and there is the regex.hpp!
And don't do the mistake I did "$(#boost)" <---NO BLANKS HERE (or it will cost you hours of debugging).
The same for the Linker.
Remember, what "#boost.lib" is you told codeblocks in the "Global variables..." Dialog.(see above)
Last step linker settings.
Here you have to link the binarys of the librarys. The tab is just on the left side of the "search directories" tab.(see above)
In my case the librarys are in "C:\Programmieren\boost_1_51_0\stage\lib". And if you want to link regex you have to choose one of those files:
The explanation for the library names you will find in this guide under section 6.3:http://www.boost.org/doc/libs/1_51_0/more/getting_started/windows.html
I decidet to link "libboost_regex-mgw44-1_51.a" and it went well!
This is the end! And it works!