Skip to content
Advertisement

arm-linux-gnu-gcc fatal error: stdio.h: No such file or directory

These are the files in /usr/bin

JavaScript

I am following this tutorial to cross compile a simple C program:

JavaScript

Now I save this is a .c file and try to compile it;

JavaScript

This is hapening only when I am using arm-linux-gnu-gcc.

But when I am using gcc, it works fine.

Why is arm-linux* giving this error?

Update

JavaScript

Verbose

JavaScript

Host configuration

Redhat 6, 64 bit

Advertisement

Answer

The problem here, it seems, is that you installed the compiler toolchain for the target, but didn’t install a standard library for the target. You need a standard C library compiled specifically for your target platform. Either find a pre-compiled from the same place you found the compiler toolchain, or download one and cross-compile using the target toolchain.

When you have a standard C library for the target, use the flag -I (that’s uppercase i) to tell the compiler where to find the header files, and the -L flag to tell the linker where to find the libraries, and e.g. -lc (that’s the lower-case L) to tell the linker to link with the library. Something like

JavaScript
Advertisement