PDA

View Full Version : gcc/g++ missing include files


smo0th
July 28th, 2007, 09:32 PM
Hello, this is the first time I'm trying to write c code in linux and it pops the following errors:

dong.c:2:18: error: stdio.c: No such file or directory
dong.c:3:19: error: stdlib.c: No such file or directory

I checked the packages with apt-get and synaptic and everything seems ok, what should I do to get this working? :(

bbzbryce
July 28th, 2007, 09:39 PM
Hello, this is the first time I'm trying to write c code in linux and it pops the following errors:

dong.c:2:18: error: stdio.c: No such file or directory
dong.c:3:19: error: stdlib.c: No such file or directory

I checked the packages with apt-get and synaptic and everything seems ok, what should I do to get this working? :(

Can you list the code which gives you this error? Does the following work?

#include <stdio.h>

int main() {
printf("Ubuntu rocks\n");
}

Save to test.c and compile by: gcc test.c
Run: ./a.out

smo0th
July 28th, 2007, 10:13 PM
yikes!.. ](*,)

I found the error I was mispelling stdlib.c for stdlib.h, duh, sorry about that. :oops:

bbzbryce
July 28th, 2007, 10:17 PM
yikes!.. ](*,)

I found the error I was mispelling stdlib.c for stdlib.h, duh, sorry about that. :oops:

That's what I was thinking, but didn't want to blatantly ask. ;)

pcmanlin
July 28th, 2007, 11:35 PM
:) try:
sudo apt-get install build-essential

maybe it will work.