views:

143

answers:

4

Hi all,

I'm trying to link up some of the boost stuff with a visual C++ project of mine and am not sure what the best way to do this is, I'm specifically interested in the singleton class.

+2  A: 

You need to download boost libraries, build them. Then link against the libraries you want, and add boost directory to your additional include headers.

THis link from boost is helpful: http://www.boost.org/doc/libs/1%5F40%5F0/more/getting%5Fstarted/windows.html

navigator
+2  A: 

I don't want to RTFM but Boost Getting Started on Windows is the first place to go.

As you can see from the TOC, it is a very coherent walkthrough.

  1. Get Boost
  2. The Boost Distribution
  3. Header-Only Libraries
  4. Build a Simple Program Using Boost
    1. Build From the Visual Studio IDE
    2. Or, Build From the Command Prompt
    3. Errors and Warnings
Shay Erlichmen
+1  A: 

Most of boost is headers only and all you have to do is

  1. Download boost
  2. Move them to your include folder in visual c++
  3. Include the wanted headers:
//Your headers of choice
#include <boost/shared_ptr.hpp>
#include <boost/foreach.hpp>

This obviously doesn't work with headers you need to compile, you have the other answers for that, and I'm not familiar with any Singleton class.

Jonas
+1  A: 
  • you can download an installer from boostpro (http://www.boostpro.com/download). It's not always the latest version but it's well done and you can choose what you need. It's already pre-built with all possible options.
  • add the boost headers (for example myboostpath\boost\boost_1_39) in VC++ Directories/include
  • add the boost libs (for example ma_boost_path\boost\boost_1_39\lib) in VC++ Directories/Library Files

But I don't know of any Singleton, at least as top-level library.

Christophe Henry
Boostpro do not have msvc10 builds yet.
Sorin Sbarnea