Which package contains the C standard library?
Solution 1
This should be available in the glibc package Though most all the packages essential to development and code-building can be found in build-essential
Solution 2
The package name is libc6, if you are trying to build a C app then you will want to install the build-essential package which brings the development packages.
Solution 3
It's libc6
/ libc6-dev
. For cross compilation for 64 bit / 32 bit systems, you can install libc6-amd64
libc6-dev-amd64
or *i386 repsectively.
The -dev
packages are the ones that contain /usr/include/stdlib.h
.
Solution 4
In general, you can find which package a file belongs to using the command:
dpkg-query -S /path/to/file
In this case, this does depend on you first knowing which file is the C standard library: /lib/libc6.so.6
Related videos on Youtube
Olivier Lalonde
Updated on September 17, 2022Comments
-
Olivier Lalonde almost 2 years
Which package contains the C standard library?
-
Olivia over 13 yearsI'll add that the source package's name in recent Ubuntu versions is
eglibc
as seen at packages.ubuntu.com/…. -
Olivia over 13 yearsTo clarify, although it isn't succinctly apparent from the package description, the host-native packages are
libc6
&libc6-dev
for either i386 or amd64. For cross-compilation, i386 useslibc6-*amd64
, and amd64 useslibc6-*i386
. -
Rob Bazinet over 13 yearsbuild-essential is actually a dummy package, which has dependencies on "all you need to make a build". Very usefull, as you seldom know about all the libraries you'll actually need when building your applications from sources. But overkill if you only need the glibc.
-
Rob Bazinet over 13 yearsDaniel is right: libc6-amd64 (and its 'dev' version) are usefull only for cross-compiling from i386. Whatever your platform, if you want to build for the same platform, you only need libc6/libc6-dev.
-
flo over 13 yearsEdited the answer accordingly. That's quite important sorry I missed it. :-)