Build Boost Library with Visual Studio 2010 (x86)
By Christopher, May 5, 2010
Yesterday I struggled with building boost library for Visual Studio 2010, which I needed for my upcoming bachlor thesis.
At the moment you need to build it on your own, because no prebuild packages are available for VS2010.
I was not able to build it on the first try therefore here comes short instructions
Step by step:
- Download http://sourceforge.net/projects/boost/files/boost/1.42.0/boost_1_42_0.zip/download //1.43 beta does not work on my setup (can’t build all targets)
- Extract the boost files to C:\boost
- Open START->PROGRAMS->Microsoft Visual Studio 2010 -> Visual Studio Tools->Visual Studio Prompt
- Type:
- C:
- cd boost
- bootstrap.bat //for generating the build enviroment
-
1
| bjam --stagedir="c:\boost" --build-type=complete --toolset=msvc-10.0 --with-regex --with-date_time --with-thread --with-signals --with-system --with-filesystem --with-program_options stage |
- You could replace
1
| --toolset=msvc-10.0 with --toolset=msvc-9.0 |
if you want to build it with Visual Studio 2009
- You could replace stagedir with another directory or you leave it and do it my way: after building was finished copy including lib folder to c:\boost\
- In Visual Studio add additional library and include paths to c:\boost\lib and c:\boost to your project for “Debug” and “Release” configuration
My post is based on:
http://stackoverflow.com/questions/1790291/using-boost-on-windows-visual-studio
I’m getting a syntax error from bjam. Something during your copy&paste went wrong?
Please post the error message. but i have edited the visualisation of code. now it should be correct
yes you are right! I correct it. I did mix my real enviroment with the “easy” example
Thanks so much for this simple explanation. You did a much better job than the official boost websites. Only by following your tutorial was I able to compile the old 1.44 libraries for VS2010.
Cheers mate.