Gcc package doesn't come with glibc-devel

I recently installed gcc and tried to compile a simple ‘Hello World’:

#include <stdio.h>

int main(){
	printf("Hello World");
	return 0;
}
[andrew@openmandriva-x8664 ~]$ gcc main.c 
main.c:1:10: fatal error: stdio.h: No such file or directory
    1 | #include <stdio.h>
      |          ^~~~~~~~~
compilation terminated.

Installing glibc-devel fixed this issue. But I just have a question - is it common to install it separately from gcc? You literally can’t compile anything without it. I noticed on other distros that installing gcc is pretty much “plug and play” :sweat_smile:.

My first response mentally was duh, yeah. glibc is on all installs as far as I know. Most OM users do not compile packages. Our heritage is sort of famous for that. We have a lot of non-technical users. If you install a package that needs glibc-devel that would install as a dependency. Also OM uses clang, only using gcc when we have to.

Anyone that wants to do package building needs to install additional software. This is one approach (The RPM packaging module):

Maybe this is what you need ?

sudo dnf --refresh install rpm-build packaging-tools

Postedit:
or install the same from om-welcome, yes, as in @ben79’s screenshot.

1 Like

I get it now, sorry for such a newbie question

NP. Your question is legit.

1 Like