Le 20 janv. 2017 à 21:24, Matthew LeRoy < email@hidden> a écrit :
From: Rich SiegelDate: Friday, January 20, 2017 at 1:36 PMTo: Matt LeRoyCc: Jens Alfke, "email@hidden"Subject: Re: C++11 headers missing in /usr/include On Friday, January 20, 2017, Matthew LeRoy <email@hidden> wrote:
To put it another way: I want the libc++/C++11 headers to actually exist on the filesystem (either directly or via a symlink) in a path that starts with “/usr/include/…”.
This can be done simply and safely with the Xcode command-line tools installer. On the Xcode menu, choose Open Developer Tool -> More Developer Tools. This will take you to <https://developer.apple.com/download/more/?=for Xcode>
(requiring you to log in to your developer account along the way).
On that page you will find options for "Command Line Tools", with variations for different OS and Xcode versions. Pick the one that matches what you're using, download it, and run the installer.
There's no need for symlinking or other craziness.
R. -- Rich Siegel Bare Bones Software, Inc. <email@hidden> <http://www.barebones.com/>
Someday I'll look back on all this and laugh... until they sedate me.
Thanks, everyone, for the replies.Yes, Visual Studio Code is just an “editor”, and uses Clang tools behind the scenes (on macOS, anyway). No, I would not attemptto tell a non-Clang compiler to use Clang’s headers — I fully appreciate and understand why that’s a bad idea. But the reason Ican’t just pass "-stdlib=libc++" or "-std=c++11” to the compiler and let it figure out the correct paths, as has been suggested,is that I’m not invoking the compiler at all.VS Code has an extension which enables a richer C/C++ editing experience (think autocomplete, symbol indexing, thatsort of stuff), and so the extension needs to be able to parse all of my source code (as well as #included files). Which means Ineed to configure the extension and tell it where to search for #included files so it can find and parse them.But really, the fact that I’m using VS Code is immaterial; it could just as well be any other editor or developmenttool which needs to be able to parse my code, including resolving #include statements. So forget the fact that I’m using VSCode entirely.Surely the entire point of the Xcode Command Line Tools package is to install the necessary tooling (including headers) in“standard” locations (e.g. /usr/include) so that tools other than those provided by/with Xcode can find and use them withouthaving to know where to find them inside the Xcode.app bundle. In fact, that’s exactly the solution Rich suggested: install theXcode Command Line Tools. But as I said in my original message, I already did that. Unfortunately it appears to have installedthe old libstdc++ headers, which don’t include the headers that are new in C++11. I want it to install the libc++ headers, whichpresumably *do* include C++11 headers like <codecvt>.So, am I doing something wrong? Does it seem odd that the Command Line Tools are installing the old libstdc++ headers and notthe libc++ headers?
As it has already been said, libc++ headers are part of the toolchain, not the system. Toolchain specific headers are not exposed in /usr/include but are in /Library/Developer/Toolchains/<toolchain>/usr/include
|