0

I just installed boost 1.58 for Visual Studio 12 and created an environment variable BOOST_DIR for the boost root directory. Furthermore, I added the folder %BOOST_DIR%\stage\lib to the PATH environment variable, where all the library files (DLL's + libs) were installed.

Now, in order to test the boost installation, I created a new project and added $(BOOST_DIR) to the Additional Include Directories. For some reason, this seems to be enough to get the project build and run successfully. For all other libraries, I was used to also include the library directory to Additional Library Directories and add the actually used libraries to Linker -> Input -> Additional Dependencies.

Could someone please explain to me why this isn't necessary in the case of boost libraries?

This is the sample code I use to test whether boost works:

#include <boost/lambda/lambda.hpp>
#include <iostream>
#include <iterator>
#include <algorithm>

int main()
{
    typedef std::istream_iterator<int> in;

    std::cout << "Type in any number: ";

    std::for_each(
        in(std::cin), in(), std::cout
        << (boost::lambda::_1 * 10)
        << "\nType in another number: ");
}
Schnigges
  • 1,284
  • 2
  • 24
  • 48

1 Answers1

2

Most Boost libraries are header-only, which means you just need to include the header to use it. It is true for all the libs listed in this answer.

As quoted from the Boost Lambda documentation:

The library consists of include files only, hence there is no installation procedure. The boost include directory must be on the include path.

Community
  • 1
  • 1
BlackDwarf
  • 2,070
  • 1
  • 17
  • 22