[英]header files not recognised in C++
I have a folder named apt-util
with header files in include directory. 我有一个名为
apt-util
的文件夹,其中头文件位于include目录中。 When I tried to compile the source code in which I include these files, it is saying : 当我尝试编译包含这些文件的源代码时,它的意思是:
parseFile.C:17:36: error: apt_util/unicode_utils.h: No such file or directory
In my code, I included this file like this: 在我的代码中,我包含了这样的文件:
#include <apt_util/unicode_utils.h>
How to resolve this error? 如何解决这个错误?
I am using Linux OS and compiling using g++. 我正在使用Linux OS,并使用g ++进行编译。
If you reference a header with a relative path, use "
instead of <>
如果引用具有相对路径的标头,请使用
"
代替<>
#include "apt_util/unicode_utils.h"
You also seem to have a wrong path : apt_util
instead of apt-util
. 您似乎也有错误的路径:
apt_util
而不是apt-util
。
给您的编译器有关包含目录的基本路径的提示,例如
gcc -I/usr/local/src ...
如果目录apt_util
是当前工作目录的子目录,您应该使用#include "apt_util/unicode_utils.h"
吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.