Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

stdio.h not found after fresh xcode 4.3 installed

Tags:

xcode

xcode4.3

After upgrading to Lion, and installing XCode 4.3 I can't get "Hello, World" to compile.

include <stdio.h>

int
main ( int argc, char *argv[]) {

    printf("Hello, World!\n");
}


$ gcc hello.c 
hello.c:1:19: error: stdio.h: No such file or directory

I see a stdio.h in ./SDKs/MacOSX10.6.sdk/usr/include/stdio.h, but it's a little surprising that there isn't a 10.7 version. Did my install fail? It reported success.

The standard solution to this problem, after some Googling, is to reinstall XCode. But XCode is delivered through the App store with doesn't give me a re-install option. I also never saw the various other options such as "Unix development" which are referenced in other places.

Ideas?

like image 517
Leonard Avatar asked Feb 19 '12 18:02

Leonard


1 Answers

It turns out the solution is to download the "command line tools" package. Once downloades, run the package installer and all is well. The /Developer directory is obsolete, no longer used in Xcode 4.3

The Apple developer web site is my friend

like image 134
Leonard Avatar answered Jan 02 '23 00:01

Leonard