QtCreator compile returning stdlib.h: No such file or directory
I've just started getting this error after updating to QtCreator 4.2.0, Qt 5.7.1 on a Raspberry Pi3 running the latest Rasbian and the QtCreator from the repositories. I am not building an Android app, just a desktop app for the Raspberry Pi3.
I try to build now and I get an error from cstdlib caused by:
From my research, the problem is caused by using -isystem /usr/include, but I don't know how to tell QtCreator that I don't need that.
Anyone know what can be done to correct this?
@GregWilsonLindberg After upgrading did you try to delete build directory, run qmake and build again?
@jsulm I had deleted the directory when I copied the project to the new uSD card. I tried deleting the build directory again and I got the same results as before.
@jsulm I hadn't forced qmake to run, but I deleted the build directory and then ran qmake and then did the build and I am getting the same error.
The compiler is still showing the offending '-isystem /usr/include' option. It seems that this is what I need to get rid of.
I'd try deleting the <project>.pro.user file; it seems to be often conflicting when updating QtCreator, but deleting it and thus reconfiguring the project fixes things.
@mvuori even deleting the .pro.user file & the build directory, opening the project and rerunning qmake does not get rid of the error.
I think that the g++ version is what is doing it. The old version of rasbian
is using g++ v4.9.2. The new version of rasbian is using g++ v6.3.0-18+.
For the old compiler we had had to add an "INCLUDEPATH =
/usr/include" line into the .pro file to get everything picked up
properly. For the new compiler (and the change from #include to #include_next
in cstdlib) that messes up.
I'm removing the INCLUDEPATH, (which seems to have been included as -isystem
instead of -I) and that is fixing the problem.