How to include header files in Visual Studio 2008?

后端 未结 4 740
感动是毒
感动是毒 2021-02-14 18:03

I am currently trying to compile a simple program that includes two header files. I see them in the Solution Explorer, where I included them through \"include existing files\".

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-14 18:32

    There are two ways to do this.

    1) Only for the current project

    Select your project -> properties -> C/C++ -> General -> Additional Include Directories -
    Include your header file directory.
    

    2) For all projects

    Tools -> Options -> VC++ Directories -> Include files - Add the header file directory.
    

    Refrain from using 2, as it would be difficult to figure out dependencies for a project when compiling it on a system different than yours.

提交回复
热议问题