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.