Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setup boost and use with Visual Studio 2010 Express

I know that similar questions you can find in web and, particularly in stackoverflow but I still need to write this question because i could no find any page where there is a step by step tutorial how to setup boost library and integrate it with visual studio 2010 express. Even here: How to use Boost in Visual Studio 2010 there are steps (e.g. 3, 4) that I can't find the menus or so...

So please help me to be able to use boost with visual studio 2010 express on Win7.

like image 281
Narek Avatar asked Feb 01 '12 11:02

Narek


People also ask

How do I link my Boost library to Visual Studio?

6.1 Link From Within the Visual Studio IDE Right-click example in the Solution Explorer pane and select Properties from the resulting pop-up menu. In Configuration Properties > Linker > Additional Library Directories, enter the path to the Boost binaries, e.g. C:\Program Files\boost\boost_1_55_0\lib\.


2 Answers

For building:

  1. Download Boost from here: http://www.boost.org/users/download/ and extract files
  2. Double click on build.bat file
  3. Press Win+R, type cmd and press enter. The cmd.exe will be invoked.
  4. In cmd.exe type "cd the_directory_name_where_you_run_build.bat" and press enter
  5. Then type "bjam --prefix=C:\Boost install"

See here the item 1.3 (Installation) for building and building details: http://en.highscore.de/cpp/boost/ Also this a very good Boost tutorial/book with lots of examples.

Then the rest is to set include directories and static link directories in MVS and that all. In order to do that in Solution Explorer right click on the solution name you want to compile, and go to Properties->Configuration Properties->VC++ Directories and for Include Directories and Library Directories add appropriate paths to header (.hpp) and static library (.lib) files. (Search them in C:\Boost!)

like image 102
Narek Avatar answered Sep 21 '22 23:09

Narek


I meet some linking issue when I install boost with installer from "BoostPro Computing". And I solve it by compiling boost lib from source code. Here is the steps:

  1. download boost from http://www.boost.org/users/history/version_1_52_0.html
  2. unzip it
  3. enter Visual Studio 2010 Express Command Prompt
  4. cd to the unzipped boost dir
  5. bootstrap.bat
  6. .\b2

Done.

Here is my environment:

  • Win7 64bit
  • Visual Studio 2010 Express
  • boost 1_52_0

P.S. At the end of Boost build mentions the include directory and lib directory that should be added to corresponding paths so that Visual Studio could find them.

like image 32
Yang Wu Avatar answered Sep 23 '22 23:09

Yang Wu