location of C header files
In composing this post to ask a question, I learned the surprising answer. Thought it worth sharing.
Question: I'm an experienced C programmer in Unix environments, not so much in OS X. Most of my C programs build fine on my Mac, using the gcc and make that came with Xcode. What I don't understand is why I don't have a /usr/include directory. Where has Apple put the standard C header files?
Answer: In preparing this post, I decided (FWIW) to provide the version of gcc that I'm using:
$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/Mac OSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix
$
And there was my answer!:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/S DKs/MacOSX10.9.sdk/usr/include
MacBook Pro (17-inch Early 2011), OS X Mavericks (10.9.5)