Visual Studio - Connecting a Library

When I wanted to link Visual Leak Detector, I did something magical and whenever I want to #include it, I can do so in any project without doing anything else.

With the boost library, I have to link it to every project individually before I can use it. In the C/C++ settings, the directory to the Visual Leak Detector library is *always* in the "Additional Include Directories". And when I go in to add the Boost library in that same place, the Visual Leak detector library is placed under "inherited values" while adding the Boost library only adds it to "Evaluated Value":

What am I doing wrong? Is there a reason why Boost has to be included every time and not Visual Leak Detector? Or did I just forget how I did it? :(

You have to add the Boost directory to the default header search paths. This used to be much easier in earlier versions because it was in a reasonable location. Nowadays:

First you need to load any C++ project or solution. Then open the property manager (View > Property Manager), and you'll see a window listing every C++ project in the solution. Expand any of them and you'll see a folder for each build configuration. Open one and one of the items will be "Microsoft.Cpp.<architecture>.user". Right-click > Properties > Common properties > VC++ Directories > Include directories is where you add new directories. You have to do this for both x86 and x86-64. Note that although it looks like you're setting something just for that one project, the setting is actually compiler-wide.
You'll also need to add the library location. Although Boost will automatically link to the correct .lib, the compiler still needs to know where to look for them.

What do you mean "it's not intuitive"?
Wow, thanks. That's the weirdest way to ever do that. I did none of that with Visual Leak Detector, might have updated Visual Studio since then. Saved my life, thanks again :3
For VS 2017/2019 the Property Manager option is "hidden" in a sub menu: View -> Other Windows - > Property Manager.

@zapshe, I suspect the setup for the leak detector did all the work of setting things to be part of the IDE defaults. Something Boost won't do.

I don't know for sure, just a SWAG.
SWAG = Sure wild ass guess?

And yea, I had to go into the other windows thing to find Property Manager.

Visual Leak Detector may have done it itself, but I remember having to include it somewhere in those directories before it actually worked. Maybe I'm just getting old.
SWAG = Silly Wild Ass Guess.
So close :(
At least it wasn't horse-shoes or nukes. :D

I am glad you asked the question since I have been wondering how, if at all, to make 3rd party library headers and library files be automatically included when using them. I would never have thought to go looking for the property manager.
Last edited on
Topic archived. No new replies allowed.