Rate This Document
Findability
Accuracy
Completeness
Readability

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:

1
test.c:1:10: fatal error: stdio.h: No such file or directory

The code is as follows:

1
2
3
4
5
6
 #include <stdio.h>
 int main()
{ 
     printf("hello!\n"); 
     return 0;
 }

gcc -v:

1
2
3
4
[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.

1
yum install glibc-devel -y

If the OS is not connected to the Internet, perform Configuring the OS Yum, APT, or Zypper Source first.