Installing the latest version of Boost C++ from source on Windows for use in Visual C++ in 5 simple steps

by APIJunkie 23. January 2012 06:38

If you wish to use the latest Boost C++ libraries in your Visual C++ projects and the automated Boost installers at: http://www.boostpro.com/download/ are not up to date, crashing (happened to me) or you just want to build them yourself,  you can follow a few simple steps to get the job done.

1. Download the latest version of Boost from:

http://www.boost.org/users/download/

The direct link for the current version (1.48.0) can be found at:

http://sourceforge.net/projects/boost/files/boost/1.48.0/boost_1_48_0.zip/download

 2.  Extract the compressed file to a directory of your choice

Example: C:\SrcLibs\ boost_1_48_0

 3. Open a command prompt in the directory you created in step 2.

Example: C:\SrcLibs\ boost_1_48_0

 4. Type the following 2 commands at the command prompt:

 bootstrap.bat

 b2

 The above commands will configure and build the Boost libraries from source.

 It will take some time to build the libraries depending on your hardware.

 If all has gone well you should see a message along the lines of:

 The Boost C++ Libraries were successfully built!

 The following directory should be added to compiler include paths:

     C:\SrcLibs\ boost_1_48_0

 The following directory should be added to linker library paths:

     C:\SrcLibs\ boost_1_48_0\stage\lib

 5.  Add the Boost include and library path to a Visual C++ project

For example in Visual Studio 2010:

Create a new C++ console application

Go to Project/Properties/Configuration Properties/VC++ Directories/

Set Include Directories to:

C:\SrcLibs\ boost_1_48_0;$(IncludePath)

 Set Library Directories to:

C:\SrcLibs\ boost_1_48_0\stage\lib;$(LibraryPath)

That’s it; you can start writing code that uses Boost…

 

 

 

Tags:

C++ | How To | Visual Studio | Boost

Comments

Comments are closed

About the author

Name of author

I was first wounded by x86 assembly, recovered and moved on to C. Following a long addiction to C++ and a short stint at rehab I decided to switch to a healthier addiction so I am now happily sniffing .NET and getting hooked on Silverlight.

I am mainly here to ramble about coding, various API’s, Junkies(me especially) and everything else that happens between coders and their significant other.

  James Bacon