SARATH
SARATH

Reputation: 49

Header files not recognised in C++

I have a folder named apt-util with header files in a include directory. When I tried to compile the source code in which I include these files, it was 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 the Linux OS and am compiling using g++.

Upvotes: -1

Views: 536

Answers (3)

DuncanACoulter
DuncanACoulter

Reputation: 2156

If the directory apt_util is a subdirectory of your current working directory, you should be using #include "apt_util/unicode_utils.h" instead.

Upvotes: 0

PP.
PP.

Reputation: 10864

Give your compiler a hint about the base path of your include directories, e.g.

gcc -I/usr/local/src ...

Upvotes: 1

Arnaud Denoyelle
Arnaud Denoyelle

Reputation: 31263

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.

Upvotes: 4

Related Questions