-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fatal error: stdlib.h: No such file or directory from #include_next <stdlib.h> #2706
Comments
Hello @mattpulver , We've tried to reproduce the issue with all the software versions as reported except Arch Linux though with no luck. Did you have any progress on your side meanwhile? |
Yes I'm able to get through this by adding
to the I haven't tracked down where the
|
Describe the bug
Fatal error when building:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
It should build successfully
Diagnosis and Fix
The problem first occurs at this step:
which results in the above
fatal error
. We can see the reason for this by adding-v
to theg++
command. It reports:From the error message:
In context, that line in
/usr/include/c++/13.2.1/cstdlib
is:What should happen is that
stdlib.h
is included from/usr/include
. However since/usr/include
precedes/usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../include/c++/13.2.1
in the above#include <...> search
paths, it doesn't find it, resulting in the error.The source of how these
#include <...> search
paths got mixed up is from@./__work_gnu/md/lnx32e/oneapi_dynamic/inc_y_folders.txt
which is in the aboveg++
command:Note the last parameter
-isystem/usr/include
. By simply excluding this from theinc_a_folders.txt
andinc_y_folders.txt
generated files fixes the problem. Making this change results in/usr/include
coming correctly after/usr/include/c++/13.2.1
in the#include <...> search
paths.Environment:
The text was updated successfully, but these errors were encountered: