GENie icon indicating copy to clipboard operation
GENie copied to clipboard

Is there a way to specify include dirs for `#include "..."` directives?

Open MAnyKey opened this issue 8 years ago • 3 comments

So that standard library headers will not be affected. Suppose I have sample.cpp:

#include <random>
... some code

in glibc++'s random there is #include <debug/debug.h>. If I specify includedirs { "./somedir" } and create "somedir/debug/debug.h" compilation of sample.cpp will fail because cpp will include my header instead of /usr/include/c++/5/debug/debug.h

MAnyKey avatar Apr 20 '16 19:04 MAnyKey

Use #include "debug/debug.h"

bkaradzic avatar Apr 20 '16 20:04 bkaradzic

What do you mean by saying use #include "debug/debug.h". It is not even my code, it is libstdc++'s: https://github.com/gcc-mirror/gcc/blob/master/libstdc%2B%2B-v3/include/std/random#L43 Solution to this in gcc (I'm almost sure that other compilers can do that) would be to specify -iquote instead of -I for some directories.

MAnyKey avatar Apr 21 '16 17:04 MAnyKey

See discussion in PR #180

jeduden avatar May 15 '16 15:05 jeduden