简体   繁体   English

#包括 <header.h> 错误:无法打开源文件“ header.h”

[英]#include <header.h> error: Cannot open source file “header.h”

I'm trying to include the header of a class called Person (Person.h) into my implementation of Person (Person.cpp), but I keep getting an error saying: 我正在尝试将名为Person(Person.h)的类的标头包含到我的Person(Person.cpp)的实现中,但是我不断收到错误消息:

"cannot open source file Person.h" “无法打开源文件Person.h”

The .h file and .cpp file are in the same directory: .h文件和.cpp文件位于同一目录中: 在此处输入图片说明

And these are my settings of the include directories: 这些是我对include目录的设置: 在此处输入图片说明

use #include "header.h" instead of #include <header.h> to include project files. 使用#include "header.h"代替#include <header.h>来包含项目文件。 Read C++ Primer for more reference. 阅读C ++ Primer以获取更多参考。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 #包括 <Header.h> #include“ Header.h”正在编译时未编译 - #include <Header.h> is not compiling while #include “Header.h” is compiling #include &lt;../ header.h&gt;在C ++中是一种不好的做法吗? - Is #include <../header.h> a bad practice in C++? 制作#include <header.h> 仅对其自己的库可见 - Make an #include <header.h> only visible for its own library 类header.h不包含在main中 - class header.h not included in main CMake 强制包含语句以具有 #include 格式<mylib header.h></mylib> - CMake force include statements to have form #include <mylib/header.h> 函数未在作用域中声明/如何将header.h,header.cpp和main.cpp一起使用? - Function not declared in scope / How use header.h, header.cpp, and main.cpp together? 分离header.h、main.cpp和implementation.cpp中的代码 - Separating the code in header.h, main.cpp and implementation.cpp 在头文件或源文件中包含stdafx.h? - include stdafx.h in header or source file? 如何解决此错误:#include <gl/glut.h> “无法打开源文件gl / glut.h” - How to fix this Error: #include <gl/glut.h> “Cannot open source file gl/glut.h” 无法打开包含文件&#39;afxwin.h&#39;:vs 2013 c ++中没有这样的头文件或目录 - Cannot open include file 'afxwin.h':no such header fileor directory in vs 2013 c++
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM