stdio.h Not Found When Compiling the Demo Program
Symptom
The image file is openEuler-22.03-LTS-SP3-aarch64.qcow2.xz. When the demo program is being compiled, the following error message is displayed:
test.c:1:10: fatal error: stdio.h: No such file or directory
The code is as follows:
#include <stdio.h>
int main()
{
printf("hello!\n");
return 0;
}
gcc -v:
[root@localhost bin]# gcc test.c -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/opt/aarch64/compiler/gcc-10.3.1-2023.12-aarch64-linux/bin/../libexec/gcc/aarch64-linux-gnu/10.3.1/lto-wrapper
Possible Causes
The stdio.h file is provided by the glibc-devel package and glibc-devel is not installed.
Troubleshooting Procedure
Install the glibc-devel package and recompile the program.
yum install glibc-devel -y
Parent topic: FAQs