问题描述
在 C++ 和 Visual Studio 2017 中,
In C++ with Visual studio 2017,
我将一些头文件复制到我的项目文件夹中,然后将它们添加到 C++ 中的解决方案资源管理器"下.现在当我写
I copied some header files into my project folder, then added them under the "solution explorer" in c++. Now when I write
#include "name.h"
它在包含下打印一个错误,并说无法打开源文件".
it prints an error under include, and says "cannot open source file".
为什么,我可以做些什么来修复它?
Why, and what can I potentially do to fix it?
我刚刚下载了 VS,并且是第一次学习 C++.
I only just downloaded VS and am learning c++ for the first time.
推荐答案
如果您使用的是 Visual Studio,请右键单击该项目,然后单击属性",在配置属性"下单击C\C++",然后将目录添加到您的附加包含目录部分下的头文件.
If you're using Visual studio, right click on the project and then on Properties, Under Configuration Properties click on C\C++ and then add the directory to your header files under the Additional Include Directories section.
这篇关于C++无法打开源文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!