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: Fri, 20 Jan 2017 20:24:00 +0000
- Thread-topic: C++11 headers missing in /usr/include
From: Rich Siegel
Date: Friday, January 20, 2017 at 1:36 PM
To: Matt LeRoy
Cc: 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 attempt
to tell a non-Clang compiler to use Clang’s headers — I fully appreciate and understand why that’s a bad idea. But the reason I
can’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, that
sort of stuff), and so the extension needs to be able to parse all of my source code (as well as #included files). Which means I
need 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 development
tool which needs to be able to parse my code, including resolving #include statements. So forget the fact that I’m using VS
Code 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 without
having to know where to find them inside the Xcode.app bundle. In fact, that’s exactly the solution Rich suggested: install the
Xcode Command Line Tools. But as I said in my original message, I already did that. Unfortunately it appears to have installed
the old libstdc++ headers, which don’t include the headers that are new in C++11. I want it to install the libc++ headers, which
presumably *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 not
the libc++ headers?
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