In a fresh Alpine Linux I installed GCC by
apk add --update-cache gcc
but still a simple program
#include <stdio.h>
int main(int argc, char *argv[]) {
return 0;
}
compiled with message
fatal error: stdio.h: No such file or directory
In a fresh Alpine Linux I installed GCC by
apk add --update-cache gcc
but still a simple program
#include <stdio.h>
int main(int argc, char *argv[]) {
return 0;
}
compiled with message
fatal error: stdio.h: No such file or directory
Install
libc-dev
in addition to GCC, or just installbuild-base
for everything (alpine-sdk
is probably an overkill). To install run the following command:You need to install it separately because in Alpine Linux, the package GCC doesn't depend on
libc-dev
for good reason:And August Klein also noted that in Debian, GCC only recommends
libc-dev
for the same reason (but most people don't do--no-install-recommends
anyway).