Jump to content
  • Advertisement
too_many_stars

VS2012 and Additional Inclue Directories

Recommended Posts

Hello Everyone,

A quick question regarding Visual Studio 2012.

Under Configuration Properties, we have VC++ Directories -> Include Directories

Under C/C++ we have General->Additional Include Directories

What exactly is the difference and when should I be using the C/C++ Additional Include Directories?

 

Thanks,

Mike

Share this post


Link to post
Share on other sites
Advertisement

The VC++ Directories -> Include Directories corresponds to the environment variable INCLUDE in windows. This can be thought of as a global variable that is applicable to all solutions on that Windows PC.

C/C++  General->Additional Include Directories applies to the project level only.  This is the one you should use the most, because it is the setting that is persistent when porting your project onto a different PC.  However, this often means you have to set it for each project.

Share this post


Link to post
Share on other sites

@desiado - Thanks, I think I understand. So every solution on my PC will be able to see what's in one VC++ Directories -> Include Directories as opposed to project level only.

 

@ChaosEngine - It's an old laptop and I have not bothered updating. However, as soon as I get something newer, that will be the first thing I do.

 

Thanks so much guys!

Share this post


Link to post
Share on other sites
On ‎14‎/‎02‎/‎2018 at 5:39 PM, too_many_stars said:

So every solution on my PC will be able to see what's in one VC++ Directories -> Include Directories as opposed to project level only

Yes and no.  The VC++ directories for your project will get populated with the global value on creation.  You can edit it, but if you want this edit to be persistent across all projects on your PC, then you need to edit the VC++directories in your user property sheet and not in the project properties window.
 
To explain further, the VC++ directories is a confusing setting now because it dates back to when it was a global setting in the visual studio IDE i.e. in VS2008 and earlier it was accessed from the top tools bar, Tools ->Options.  Since VS 2010 you can now override this global setting on a per project basis in the project properties window.  At the same time it was also removed from the top tools bar.  Now this ability to override the global settings on a per project basis, although useful, is confusing because:-
a) To now edit the VC++ directories on a global basis on your PC, you need to edit your user property sheet.
b) VC++ directories in the project properties window now shares similar abilities as the 'Additional include directories'.  Hence your confusion.
 
I think Brian Tyler explains it better here in his blog
 
and also worth looking at how user property sheets work in VS
 
Now that said, to decide which of the two include settings to use. I think in general it is simplest to use them as they were originally designed for. That is, the VC++ directories should be treated as global paths to directories that will apply to all solutions on your PC like the VC include paths and major SDKs like the Windows SDK.  Your project will automatically be set to these defaults on creation and only change this if you wish to override the default settings.  For additional includes, you should use the additional includes setting, like if you need to add includes from your other projects or third party includes and anything that only applies to the local solution (game) you are working on.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!