Issue
when using -Idir1 flag to add include path, gcc search dir1 BEFORE system standard include dir, e.g:
$ cpp -v /dev/null -I$HOME/glibc/include -o /dev/null
gcc will search $HOME/glibc/include first,then the standard include dirs:
/usr/lib/gcc/x86_64-linux-gnu/9/include
/usr/local/include
/usr/include/x86_64-linux-gnu
/usr/include
How to adjust include dir order, e.g: search standard include dir first, then the -Idir ? Thanks!
Solution
There might some solutions for this, but the comment that Dmytro Ovdiienko posted provided the answer:
Did you try to use
-idirafter
key? See: gcc.gnu.org/onlinedocs/gcc/…
Answered By - chenzero Answer Checked By - Dawn Plyler (WPSolving Volunteer)