Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Which package contains the C standard library?

share|improve this question
add comment

4 Answers

up vote 5 down vote accepted

This should be available in the glibc package Download glibc Though most all the packages essential to development and code-building can be found in build-essential Download build-essential

share|improve this answer
    
build-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. –  Little Jawa Nov 27 '10 at 8:33
add comment

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.

share|improve this answer
    
I'll add that the source package's name in recent Ubuntu versions is eglibc as seen at packages.ubuntu.com/…. –  Daniel T Chen Nov 26 '10 at 20:54
add comment

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.

share|improve this answer
1  
To 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 uses libc6-*amd64, and amd64 uses libc6-*i386. –  Daniel T Chen Nov 26 '10 at 21:01
    
Daniel 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. –  Little Jawa Nov 27 '10 at 8:39
    
Edited the answer accordingly. That's quite important sorry I missed it. :-) –  Stefano Palazzo Nov 27 '10 at 9:10
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.