1

I am using Ubuntu 10.10 as VM and am new to it. Until recently i could easily compile C programs from the terminal. However, as i try to compile them now it gives a message as:

/usr/bin/ld: cannot find -lc 
collect2: ld returned 1 exit status

I have searched for it over the net but could not figure out what is going wrong. I know the answer to it must be simple but any help would be appreciated. Thanks!

akaHuman
  • 1,332
  • 1
  • 14
  • 33

2 Answers2

3

Installing the necessary tools should solve your problem. Try:

sudo apt-get install build-essential
octopusgrabbus
  • 10,555
  • 15
  • 68
  • 131
Scroog1
  • 3,539
  • 21
  • 26
0

You probably -- most of us do -- installed Ubuntu desktop, but not Ubuntu server. A whole lot of tools don't come over with a default Ubuntu desktop installation.

So start by installing build-essential:

sudo apt-get install -y build-essential

Then try the compile again. build-essential contains a bunch of components that you need to perform a basic compile.

For my work, beyond build-essential, I have to install other libraries like curses. However, I first have to have build-essential installed before I can do anything else.

octopusgrabbus
  • 10,555
  • 15
  • 68
  • 131