Sebastian Faust wrote:
> Hi,
>
> I hava a somehow strange problem. I hope I am not wrong in this group;
> if this is the case please let me know.
>
> I am trying to compile a rather simple C program. As long as I use:
> #include <extp.h>
> gcc tells me that he cannot find extp.h.
> As soon as I write
> #include "extp.h"
> the compiling continues. Unfortunately, in extp.h there are again
> #includes that use <> so I get a similar error later on during the
> compiling process. Probably it is a problem with the environment
> variables or paths.
More likely, it is a problem with not understanding the difference
between #include <x> and #include "x".
The #include <x> form is meant for system headers, so the compiler will
only look in those places where it knows that system headers are
stored.
The #include "x" form, on the other hand, is meant for user headers.
With this form, the compiler will first look in the current directory.
If the header can not be found there, the search continues as if the
form #include <x> was used.
If the extp.h file is part of the current project, then you should
rewrite the header to use the #include "x" notation for non-system
headers (and for including the file itself in the source code).
If the extp.h file belongs to an external library, then you could tell
the compiler to add the directory where it resides to the search path
for system headers. How to do this is compiler dependent and should be
documented in the compiler documentation/help-file.
>
> Thanks for your help!
> Sebastian
Bart v Ingen Schenau
--
a.c.l.l.c-c++ FAQ:
http://www.comeaucomputing.com/learn/faq
c.l.c FAQ:
http://www.eskimo.com/~scs/C-faq/top.html
c.l.c++ FAQ:
http://www.parashift.com/c++-faq-lite/