On Tue, Feb 02, 2016 at 01:32:17PM +0100, Sandro Mani wrote:
Hi
qt-creator builds have started to fail, I've reduced the failure down to
having "-isystem /usr/include" in the command line:
Don't use -isystem /usr/include for C++, unless you also include first all
the C++ include directories as -isystem too. Why do you need that?
-isystem /usr/include is the default, but in proper place, not prepended
before system headers.
$ cat test.cpp
#include <algorithm>
$ g++ -isystem /usr/include -c -o test.o test.cpp
In file included from /usr/include/c++/6.0.0/bits/stl_algo.h:59:0,
from /usr/include/c++/6.0.0/algorithm:62,
from test.cpp:1:
/usr/include/c++/6.0.0/cstdlib:75:25: fatal error: stdlib.h: No such file or
directory
#include_next <stdlib.h>
Without the -isystem /usr/include, it compiles.
Bug in GCC?
No.
Jakub