What is the difference between “Include Directories” and “Additional Include Directories”

后端 未结 3 775
無奈伤痛
無奈伤痛 2020-11-30 23:29

In configuration properties of my project, under the \"VC++ directories\" there is an entry for \"Include Directories\". But under \"C/C++\" option, there is another entry c

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-30 23:46

    CONFIGURING INCLUDE PATHS

    VC++ Directories: Include Directories

    • this value is inherited from the INCLUDE Windows environment variable which is defined outside of Visual Studio
      • environment variables can be: global to the computer or have user level scope
      • The INCLUDE and LIB environment variables are created when the Microsoft Windows SDK is installed with Visual Studio.

    C/C++: Additional Include Directories

    • is a project level setting... you will have to define this value for every project in your solution
    • this value can be persisted to source control

    ADDITIONAL NOTES

    Which one should I use?

    The decision to use Include Directories or Additional Include Directories will depend on your organization's development process. In my opinion, it is more important:

    • that you are able to consistently and reliably re-create the development environment (think: handing off source code to another developer)
    • for developers within an organization use a consistent approach

    A Note About Macros

    • The C++ project configuration macros (not to be confused with C++ pre-processor #define directive) inherit content from different sources. Macros like...
      • $(Include) inherit their values from Windows environment variables
      • $(OutDir) inherit their values from Visual Studio IDE

    REFERENCES

    • Environment Variables (general introduction)
    • How to set the path and environment variables in Windows

提交回复
热议问题