Using Boost and Visual Studio

2019-08-15 11:43发布

问题:

I did see some similar questions about this - but I couldn't piece together what I needed.

I'm using boost in a project in Visual Studio 9, and I'm unable to get it to recognize all the header files that I'm trying to include. I'd installed Boost using the Windows installer that also places the binaries on my machine.

In Visual Studio, I modified the Project->Properties->Linker->Additional Libarary Dependencies to include the folder "mypath\boost_1.44\lib", which contains the binaries - but I still can't get VS to recognize my Boost header files. Please help!

Cheers.

回答1:

edited to clarify some text

You need to modify the project properties to add header locations for the boost headers as well. If you want a global setting, this is how you do it:

Tool->Options->Projects and Settings->VC++ Directories. Then on the right hand side, Open the dropbox labeled "Show Directories For" and pick "Include Files".

Add a new line for your boost header path.

This is a screenshot from VS2008 - it is similar in VS2010 and VS2005.

Additionally, you can also set these directories on a per-project basis by modifying each project's specific properties.