The phenomenon of
I recently wrote a small program under Ubuntu that always reports the following errors when running:
/usr/include/c++/7/cstdlib:75:15: fatal error: stdlib.h: No such file or directory #include_next <stdlib.h>
The reason:
I found out that:
This is because GCC7 has included libstdlib.h for better optimization, and the C Library header stdlib.h USES Include_next, which is sensitive to the GCC system header path.
Solutions:
Method 1: remove the following line from the.pro file in Qt:
INCLUDEPATH +=/usr/include
Method 2:
add the following line to the Qt. Pro file:
QMAKE_CFLAGS_ISYSTEM = -I
Reference: https://stackoverflow.com/questions/52532936/usr-include-c-7-cstdlib7515-fatal-error-stdlib-h-no-such-file-or-directo