<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 23, 2016, at 11:15 AM, Cristianno Martins via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi Vivek,<div class=""><br class=""></div><div class="">you can also include these lines below to your ~/.bash_profile:</div><div class=""><br class=""></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px" class=""><div class="">LLVM_BUILD="/Developer/llvm/build" # Path to your build directory</div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px" class=""><div class="">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 class="">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 class=""><br class=""></div><div class="">where you only need to set LLVM_BUILD to where in you system you built llvm/clang.</div><div class=""><br class=""></div><div class="">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 class=""></div><div>I believe the right way is to use -isysroot with the path to the SDK:</div><div><br class=""></div><div>clang++ -isysroot `xcrun --show-sdk-path`</div><div><br class=""></div><div><br class=""></div><div>Otherwise I always end-up having other issues with missing system/platform headers.</div><div><br class=""></div><div>— </div><div>Mehdi</div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div class="gmail_extra"><br clear="all" class=""><div class=""><div class="gmail_signature" data-smartmail="gmail_signature"><br class="">--<br class="">Cristianno Martins<br class="">PhD Student of Computer Science<br class="">University of Campinas<br class=""><a href="mailto:cmartins@ic.unicamp.br" target="_blank" class="">cmartins@ic.unicamp.br</a><br class=""><a href="mailto:cristiannomartins@hotmail.com" target="_blank" class=""></a></div></div>
<br class=""><div class="gmail_quote">On Thu, Jun 23, 2016 at 2:58 PM, Jonathan Roelofs via llvm-dev <span dir="ltr" class=""><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br class="">
<br class="">
On 6/23/16 11:56 AM, vivek pandya via llvm-dev wrote:<br class="">
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
<br class="">
<br class="">
On Thu, Jun 23, 2016 at 7:36 PM, Tim Northover <<a href="mailto:t.p.northover@gmail.com" target="_blank" class="">t.p.northover@gmail.com</a><br class=""></span><span class="">
<mailto:<a href="mailto:t.p.northover@gmail.com" target="_blank" class="">t.p.northover@gmail.com</a>>> wrote:<br class="">
<br class="">
    On 23 June 2016 at 06:31, vivek pandya via cfe-dev<br class=""></span><span class="">
    <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank" class="">cfe-dev@lists.llvm.org</a> <mailto:<a href="mailto:cfe-dev@lists.llvm.org" target="_blank" class="">cfe-dev@lists.llvm.org</a>>> wrote:<br class="">
    > I am running OS X, when I build clang++ from source and use it to compile<br class="">
    > .cpp files it fails as it is not able to find C++ header. I am not building<br class="">
    > libc++ along with llvm and clang.<br class="">
<br class="">
    When I'm not building with libcxx in-tree I find it easiest to just<br class="">
    symlink Xcode's libc++ headers into the build directory. Something<br class="">
    like "ln -s<br class="">
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++<br class="">
    build/include".<br class="">
<br class="">
Thanks Tim,<br class="">
<br class="">
symlink to build include does not help because clang++ looks headers<br class="">
into build/lib/clang/3.9.0/include ( as per output of clang++ -v) but I<br class="">
</span></blockquote>
<br class="">
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 class="">
<br class="">
<br class="">
Jon<br class="">
<br class="">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
symlink to /usr/local/include , that worked I hope there is nothing<br class="">
wrong in doing so.<br class="">
<br class="">
-Vivek<br class="">
<br class="">
<br class="">
    > using -stdlib=libstdc++ solves problem partially but it fails when using<br class="">
    > C++11 threads, again it can't find <thread>, to get this work clang++ should<br class="">
    > work with -stdlib=libc++ but it fails with previous error of not finding C++<br class="">
    > headers.<br class="">
<br class="">
    Yes, the libstdc++ included with OS X is ancient (from GCC 4.2 I<br class="">
    think) and there only for compatibility reasons. It has virtually no<br class="">
    support for C++11, which LLVM needs.<br class="">
<br class="">
    Cheers.<br class="">
<br class="">
    Tim.<br class="">
<br class="">
<br class="">
<br class="">
<br class=""></span><span class="">
_______________________________________________<br class="">
LLVM Developers mailing list<br class="">
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class="">
<br class="">
</span></blockquote><span class="HOEnZb"><font color="#888888" class="">
<br class="">
-- <br class="">
Jon Roelofs<br class="">
<a href="mailto:jonathan@codesourcery.com" target="_blank" class="">jonathan@codesourcery.com</a><br class="">
CodeSourcery / Mentor Embedded</font></span><div class="HOEnZb"><div class="h5"><br class="">
_______________________________________________<br class="">
LLVM Developers mailing list<br class="">
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class="">
</div></div></blockquote></div><br class=""></div>
_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""></div></blockquote></div><br class=""></body></html>