ld
is the linker, i.e. the program that ties together the code that you wrote with the preexisting library code. -lc
means the library which is stored in the file libc.a
and which is linked because the option -lc
is passed to the linker.
libc
is the C standard library, which is automatically linked in every program unless you explicitly request that it isn't (which is rarely done except for such things as compiling libc itself, since you pretty much can't do anything without libc, and you definitely can't do anything that's vaguely portable).
You need the package that provides libc.a
. You can find it with apt-file search /libc.a
(you'll need to install apt-file
first, and initialize it by running sudo apt-file update
). The package is called libc6-dev
; most development packages in Debian and derivatives (including Ubuntu, Mint, etc.) are called libNAME#-dev
where NAME is the name of the library collection (which is not always the name of the specific library you link with, for example the libc6
package includes other libraries such as libm
) and # is a version number.
The C standard library is needed to build pretty much anything, so it's a dependency of the build-essential package, which you should include if you do any compiling.
apt-get install build-essential
want to install lots of things?