Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Dr_Maybe

macrumors 6502
Original poster
Sep 17, 2003
277
0
South America
I have the dev. tools installed, but when trying to compile a simple hello world "gcc hello.c" app I get:

stdio.h: No such file or directory

How do I compile a simple C app on Leopard?

It's hard googling for the problem, because "c" is just a letter.
 

ChrisA

macrumors G5
Jan 5, 2006
12,919
2,173
Redondo Beach, California
I have the dev. tools installed, but when trying to compile a simple hello world "gcc hello.c" app I get:

stdio.h: No such file or directory

How do I compile a simple C app on Leopard?

It's hard googling for the problem, because "c" is just a letter.

The first thing to suspect is that the error message is literally true, that you don't have a file named "stdio.h". Use Spotlight to check. You should have it if you installed the Apple dev. tools, xcode and all that, But the keyword here is "should".

About Google: The best way to use it is to cut and paste gcc's error message and place it in quotes. So in this case it would be "stdio.h: No such file or directory" (with quotes)
 

Dr_Maybe

macrumors 6502
Original poster
Sep 17, 2003
277
0
South America
You made me look at the code again :)

I had just copy-pasted it from a tutorial. There was an error in it, so I fixed it and then it worked. :eek:

Thanks for the replies. It works now :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.