<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 6, 2016 at 1:21 PM, Mehdi Amini via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><br><div><span><blockquote type="cite"><div>On Jun 23, 2016, at 11:15 AM, Cristianno Martins via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:</div><br><div><div dir="ltr">Hi Vivek,<div><br></div><div>you can also include these lines below to your ~/.bash_profile:</div><div><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div>LLVM_BUILD="/Developer/llvm/build" # Path to your build directory</div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div>alias new-clang="$LLVM_BUILD/bin/clang -Wno-expansion-to-defined -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include"</div><div>alias new-clang++="$LLVM_BUILD/bin/clang++ -Wno-expansion-to-defined -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/c++"</div></blockquote><div><br></div><div>where you only need to set LLVM_BUILD to where in you system you built llvm/clang.</div><div><br></div><div>After that, invoke "source ~/.bash_profile" on the current terminal, or simply open a new terminal, and you'll be able to use new-clang and new-clang++, instead of clang and clang++, to invoke your newest compiled binary.</div></div></div></blockquote><div><br></div></span><div>I believe the right way is to use -isysroot with the path to the SDK:</div><div><br></div><div>clang++ -isysroot `xcrun --show-sdk-path`</div><div><br></div><div><br></div><div>Otherwise I always end-up having other issues with missing system/platform headers.</div></div></div></blockquote><div><br></div><div>Can you put this in <a href="http://clang.llvm.org/docs/FAQ.html">http://clang.llvm.org/docs/FAQ.html</a> ? I've definitely seen a bunch of people ask this.</div><div><br></div><div>-- Sean Silva</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div><div><br></div><div>— </div><div>Mehdi</div><div><div><div><br></div><br><blockquote type="cite"><div><div class="gmail_extra"><br clear="all"><div><div data-smartmail="gmail_signature"><br>--<br>Cristianno Martins<br>PhD Student of Computer Science<br>University of Campinas<br><a href="mailto:cmartins@ic.unicamp.br" target="_blank">cmartins@ic.unicamp.br</a><br><a href="mailto:cristiannomartins@hotmail.com" target="_blank"></a></div></div>
<br><div class="gmail_quote">On Thu, Jun 23, 2016 at 2:58 PM, Jonathan Roelofs via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span><br>
<br>
On 6/23/16 11:56 AM, vivek pandya via llvm-dev wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span>
<br>
<br>
On Thu, Jun 23, 2016 at 7:36 PM, Tim Northover <<a href="mailto:t.p.northover@gmail.com" target="_blank">t.p.northover@gmail.com</a><br></span><span>
<mailto:<a href="mailto:t.p.northover@gmail.com" target="_blank">t.p.northover@gmail.com</a>>> wrote:<br>
<br>
    On 23 June 2016 at 06:31, vivek pandya via cfe-dev<br></span><span>
    <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a> <mailto:<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>>> wrote:<br>
    > I am running OS X, when I build clang++ from source and use it to compile<br>
    > .cpp files it fails as it is not able to find C++ header. I am not building<br>
    > libc++ along with llvm and clang.<br>
<br>
    When I'm not building with libcxx in-tree I find it easiest to just<br>
    symlink Xcode's libc++ headers into the build directory. Something<br>
    like "ln -s<br>
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++<br>
    build/include".<br>
<br>
Thanks Tim,<br>
<br>
symlink to build include does not help because clang++ looks headers<br>
into build/lib/clang/3.9.0/include ( as per output of clang++ -v) but I<br>
</span></blockquote>
<br>
That path is where clang is looking for compiler-provided headers. You should see another path in the -v output that says where it is looking for the c++ headers, which should not be in the same place.<br>
<br>
<br>
Jon<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span>
symlink to /usr/local/include , that worked I hope there is nothing<br>
wrong in doing so.<br>
<br>
-Vivek<br>
<br>
<br>
    > using -stdlib=libstdc++ solves problem partially but it fails when using<br>
    > C++11 threads, again it can't find <thread>, to get this work clang++ should<br>
    > work with -stdlib=libc++ but it fails with previous error of not finding C++<br>
    > headers.<br>
<br>
    Yes, the libstdc++ included with OS X is ancient (from GCC 4.2 I<br>
    think) and there only for compatibility reasons. It has virtually no<br>
    support for C++11, which LLVM needs.<br>
<br>
    Cheers.<br>
<br>
    Tim.<br>
<br>
<br>
<br>
<br></span><span>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
<br>
</span></blockquote><span><font color="#888888">
<br>
-- <br>
Jon Roelofs<br>
<a href="mailto:jonathan@codesourcery.com" target="_blank">jonathan@codesourcery.com</a><br>
CodeSourcery / Mentor Embedded</font></span><div><div><br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</div></div></blockquote></div><br></div>
_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br></div></blockquote></div></div></div><br></div><br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div></div>