Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xcrun clang --sysroot can not find stdio.h

Tags:

xcode

clang

xcrun

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");
 }
like image 267
Greg Coats Avatar asked Nov 03 '22 04:11

Greg Coats


1 Answers

it should work with : xcrun clang -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/

like image 57
n80fr1n60 Avatar answered Nov 15 '22 06:11

n80fr1n60