3
votes

I'm having problems with "boost library" usage for Visual Studio 2015. I have Common Tools installed, followed this video instructions:

https://www.youtube.com/watch?v=GOhHMS4I9Zw

(Basically, unzip boost, in visual studio prompt, execute, boostrap.bat, b2.exe, and in visual studio project properties, in C/C++>General>Additional Include Directories, the root of boost folder, and in Linker>General>Aditional Library Directories, "boost root"/stage/lib".

But after that, using the example of boost documentation, Visual Studio is unable to search in the boost folder. If I write the include sentence with global path (C:/...), it finds it, but all other boost files have relative paths!.

So, what am I doing wrong?. What I need to do to get Visual Studio working with boost library?

4
add the error message please - Gabriel
The error message is just Visual Studio is unable to find the "includes" you're including (boost library header files). "C1083, cannot open source file "boost/lambda/lambda.hpp" The code is the exposed in boost instructions page: boost.org/doc/libs/1_59_0/more/getting_started/… - Reaversword
@Reaversword Can you please post the following? 1) absolute path to the lambda.hpp header 2) the exact path you entered for include directories under project settings 3) the #include statement that produces that error message - Praetorian
Boost root is in "C:/boost" (to avoid space-character problems with the paths). Lambda header file is in: "C:\boost\boost\lambda\lambda.hpp" Include sentence is: "#include <boost\lambda\lambda.hpp>" (without quotes) Paths in Visual Studio (for debug and release mode are): Project>Properties>C/C++>General>Additional Include Directories: "C:/boost" (without quotes) Project>Properties>Linker>General>Additional Library Directories: "C:/boost/stage/lib" (without quotes) Project>Properties>VC++ Directories>Include Directories: "C:\boost;$(VC_IncludePath);$(WindowsSDK_IncludePath)" (without quotes) - Reaversword

4 Answers

1
votes

Yes, make sure you select 'All Configurations' in the 'Configuration' combo box when the project properties window shows up. That will apply the settings for the 'Include Directories' to all config.

0
votes

Add the absolute path of the installed boost includes at

project properties / VC++ Directories / Include Directories

$(VC_IncludePath);$(WindowsSDK_IncludePath);SOME_PATH_HERE
0
votes

Well, after some research, I still can't figure out what's really happening.

I've installed Visual Studio 2015 in Windows 10 machine, and make boost libraries work has been pretty straightforward. After that, in my regular machine, I've installed Visual Studio 2013 (last version), and one more time, has been incredibly simple to get boost libraries working on it.

So, if anybody happens the same, and simply he/she is unable to get Visual Studio 2015 working with boost libraries, perhaps he/she can make a try with the last version of Visual Studio 2013 (Update 5, VS2013.5), here:

https://www.visualstudio.com/news/vs2013-update5-vs

Anyway, would be great to know about his/her case/machine/os/etc... for if it'd be possible to discover what's happening and why it isn't working.

-1
votes

Edited.

I had the same problem, but what cheated me was the configurations. When the solution was set to active on "Release" and "x64", then when opening properties in the C++ project under the solution, it could be "Debug" instead and hence missed to set the right properties for the target.