• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: C++11 headers missing in /usr/include
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C++11 headers missing in /usr/include


  • Subject: Re: C++11 headers missing in /usr/include
  • From: Chris Cleeland <email@hidden>
  • Date: Fri, 20 Jan 2017 14:45:30 -0600



On Fri, Jan 20, 2017 at 2:24 PM, Matthew LeRoy <email@hidden> wrote:
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.

Something must be invoking the compiler.
 

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.

If you want a tool to parse your code the same way that the compiler is going to parse your code, then you need to make sure that the tool is using the same configuration as your compiler.  You could ask clang what its search paths are and configure the tool to use the same. If you change compiler or compiler options (think -D or framework or important things like -std=c++17) then your tool needs to update its notion of how to parse.
 

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.

I would not think that at all.  I would think that the CLI is so that you can invoke the compiler and tools from the command line rather than having to hunt them down inside a package or other application.
 

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?

It does seem like the CLI is either installing old or incomplete.  Maybe there's a special way to install to get C++11?

It also seems like VSPro (or any tool that wants to parse C++) ought to ask you which compiler you plan on using so that it can model its parsing after that compiler.

 _______________________________________________
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

References: 
 >Re: C++11 headers missing in /usr/include (From: Matthew LeRoy <email@hidden>)
 >Re: C++11 headers missing in /usr/include (From: Rich Siegel <email@hidden>)
 >Re: C++11 headers missing in /usr/include (From: Matthew LeRoy <email@hidden>)

  • Prev by Date: Re: C++11 headers missing in /usr/include
  • Next by Date: Re: C++11 headers missing in /usr/include
  • Previous by thread: Re: C++11 headers missing in /usr/include
  • Next by thread: Re: C++11 headers missing in /usr/include
  • Index(es):
    • Date
    • Thread