Reputation: 1342
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!
Upvotes: 1
Views: 2159
Reputation: 10685
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.
Upvotes: 0
Reputation: 3579
Installing the necessary tools should solve your problem. Try:
sudo apt-get install build-essential
Upvotes: 3