GCC can’t find stdio.h in Alpine Linux
June 29, 2023 —
Gregg Szumowski
A while ago, I installed the iSH app on my iPad which made
it possible for me to develop Python and C code as well as use it as an
SSH client. However, I ran into an issue when trying to compile C code
because the compiler couldn’t resolve stdio.h
. The
following excerpt from StackOverflow
resolves the issue:
Install libc-dev
in addition to GCC
, or
just install build-base
for everything
(alpine-sdk
is probably an overkill). To install run the
following command:
# apk add libc-dev
You need to install it separately because in Alpine Linux, the
package GCC doesn’t depend on libc-dev
for good reason: You
can use gcc
to compile things without libc
,
for example hypervisors firmware etc.
Tags: gcc, alpine-linux, ipad, ish, motd