[cfe-dev] Libtool search path on MacOS

scott constable via cfe-dev cfe-dev at lists.llvm.org
Mon Jun 26 13:40:12 PDT 2017


Hmmm. I have the same issue as this gentleman:
https://forums.developer.apple.com/thread/71209. I do have Xcode CLI tools
installed, but it has installed an older version of libc++ in my
/usr/include. The installed directory is /usr/include/c++/4.2.1 (I think
this is either C++03 or C++98), but my libtool expects /usr/include/c++/v1.
So is this actually an unresolved issue with Xcode?

Scott

On Mon, Jun 26, 2017 at 4:27 PM, Jacob Carlborg via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> On 2017-06-26 21:37, scott constable via cfe-dev wrote:
>
>> Sorry, I should have clarified. The C/C++ headers are the ones which
>> cannot be found. For clarity, here's the output of my tool with the -v
>> flag (I've hidden some sensitive names with ***):
>>
>> clang version 4.0.0 (tags/RELEASE_400/final)
>> ignoring nonexistent directory "/***/build-debug/bin/../include/c++/v1"
>> ignoring nonexistent directory "/usr/include/c++/v1"
>> ignoring nonexistent directory
>> "***/build-debug/bin/../lib/clang/4.0.0/include"
>> #include "..." search starts here:
>> #include <...> search starts here:
>>   /usr/local/include
>>   /usr/include
>>   /System/Library/Frameworks (framework directory)
>>   /Library/Frameworks (framework directory)
>> End of search list.
>>
>> Both my Xcode clang and my homebrew-installed clang find the headers
>> through the relative path "../include/c++/v1". This won't be possible
>> with my libtool unless (a) I move my libtool into the directory where
>> clang is installed, or (b) I also distribute the C/C++ headers with my
>> libtool. Both of these solutions is ugly, so I would prefer something
>> nicer.
>>
>
> If only Xcode is installed the headers are available at:
>
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeD
> efault.xctoolchain/usr/bin/../lib/clang/8.1.0/include
>
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeD
> efault.xctoolchain/usr/include
>
> This can be verified by running "clang -E  - -v < /dev/null". You'll see
> the above two paths (or something similar depending on which version of
> Xcode) are two of the paths Clang will search in.
>
> If the command line tools are installed as well, the headers will be
> available in "/usr/include" as well. As you can see with the above command,
> "/usr/include" is one of the paths Clang will search in.
>
> As can be seen in the output from your tool, the paths in
> /Applications/Xcode.app are not searched in. Since it doesn't find the
> headers I suspect you don't have the command line tools installed.
>
> Note that even though you can invoke "clang" on the command line to
> compile code, it doesn't necessarily mean that the command line tools are
> installed. You can install the command line tools by running "xcode-select
> --instal". If they're already installed, you'll get a message.
>
> All this trouble with these paths are due to, I believe, Apple wants the
> Xcode app bundle to be completely self contained and not install anything
> outside of it unless the user explicitly asks for it. I'm guessing this it
> to be compatible with the App Store.
>
>
> --
> /Jacob Carlborg
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170626/f8e30f3d/attachment.html>


More information about the cfe-dev mailing list