Re: Adding include directories (-I)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



John Love-Jensen wrote:
> Hi Sebastian,
> 
>> No, they are also searched before system includes for #include <blah.h>:
> 
> Appears to be a difference in behavior for C and C++ code.
> 
> The gcc toolchain driver has the behavior you indicated using test.c; but
> the g++ toolchain driver has the behavior I mentioned using test.cpp (given
> your example situation).

It's the same with g++:

$ cat test.cc
#include <stdlib.h>
$ cat stdlib.h
#error bla
$ g++ -c -I. -o test.o test.cc
In file included from test.cc:1:
./stdlib.h:1:2: Error: #error bla

Sebastian


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux