Re: C++11 headers missing in /usr/include
Re: C++11 headers missing in /usr/include
- Subject: Re: C++11 headers missing in /usr/include
- From: Matthew LeRoy <email@hidden>
- Date: Sat, 21 Jan 2017 22:06:20 +0000
- Thread-topic: C++11 headers missing in /usr/include
>As others have said, don’t assume it’s a law of nature that headers have to be located in /usr/include. They don’t have to be there, and on Mac they usually aren't. I don’t even have a /usr/include directory on my system, and I do tons of development
> (command-line as well as Xcode) on it.
>
>What you need to do is find where Clang is looking for header files. You can do that by opening a header in Xcode and then Command-clicking its filename in the top navigator strip to get a drop-down menu of the hierarchy, then selecting the enclosing
> directory. On my system the path is
>/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1
>Don’t be surprised that it’s inside Xcode; all the developer tools (including clang itself) are inside Xcode. /usr/bin/clang is just a tiny stub that finds and launches the real copy.
>
>—Jens
OK, problem solved — the libc++ headers are installed at /Library/Developer/CommandLineTools/usr/include/c++/v1.
The reason I appeared so insistent that they be installed to /usr/include, is because of the fact that installing
the CLT package did cause a /usr/include folder to appear where there was none before, and it the C and C++ standard
library headers. Thus, I assumed that’s where the CLT package intended to install them — it just installed the
"wrong" ones, or so I thought, and I wanted to know how to get it to install the “right ones”.
I now realize that it actually installs them to /Library/Developer/CommandLineTools/…, and the ones installed to
/usr/include were a red herring. Of course some documentation for the CLT package would’ve avoided this whole manhunt
and discussion entirely.
Oh, and /Library/Developer/Toolchains/… is not a valid path, at least on my machine (as Jean-Daniel suggested).
Thanks all!
Matt
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden