Visual Studio 2012 添加新的头文件 [英] visual studio 2012 adding new header file

查看:67
本文介绍了Visual Studio 2012 添加新的头文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Visual Studio 2012(C++ 环境)中,对于 Win32 控制台应用程序,我需要在我的项目中包含一个新的头文件.我尝试复制项目位置中的文件,但这没有帮助.该文件是 iGraphics.h,它显示在头文件列表中但不编译.正确的方法应该是什么?

In Visual Studio 2012 (C++ environment), for a Win32 console application, I need to include a new header file to my project. I tried copying the files in the project's location but that is of no help. The file is iGraphics.h and it is shown in the header files list but does not compile. What should be the correct approach?

推荐答案

您应该将该标题的路径添加到您的 C/C++ 下的附加包含目录项目设置.之后,只需 #include "iGraphics.h" 你需要它.

You should add the path to that header to the additional include directories under C/C++ in your project settings. Afterwards, just #include "iGraphics.h" where you need it.

不要只是移动头文件,也不要无缘无故地将现有的头文件添加到您的项目中.这样,您只需指定不同的文件夹即可轻松更改版本.

Don't just move header files around, and don't add existing headers to your project for no good reason. This way, you can easily change versions by just specifying a different folder.

这篇关于Visual Studio 2012 添加新的头文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆