With Xcode 4.6, under Mac OS X 10.8.2, to compile hello.c, I issued the xcrun command recommended in xcrun gcc cannot find header files but still received the error that the header file stdio.h can not be found.
$ xcrun clang --sysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/ -o hello hello.c
hello.c:2:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
^
1 error generated.
$ cat hello.c
/* C program, Hello World */
#include <stdio.h>
int main()
{
printf("Hello World \n");
}
it should work with : xcrun clang -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With