On Fri, 2012-09-28, Torsten Mueller wrote:
> I have an interesting g++ compiler question.
...
> Additional question: is -I. default or not? On the other machine, where
> everything works fine, I can remove -I. and it still compiles well.
At least with gcc, #include "foo.h" will search . by default, but
#include <foo.h> will only search the standard include path and
whatever extra places you tell it to search. The documentation should
tell you the exact rules.
I use the "foo.h" (or "foo/bar.h" or "../foo.h") form when I refer to
files in the same project/code base.
I use <foo.h> or <foo/bar.h> when I want to treat foo.h as a
potentially separate library.
No idea if this is universal. Even if the standard doesn't say, I
think it makes sense for most/all compilers to do it like that.
/Jorgen
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/
snipabacken.se> O o .