C++无法打开源文件 [英] C++ cannot open source file

查看:229
本文介绍了C++无法打开源文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 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++无法打开源文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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