<div class="gmail_extra"><div class="gmail_quote">On Fri, Apr 27, 2012 at 2:14 PM, Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 27 April 2012 15:07, Nathan Ridge <<a href="mailto:zeratul976@hotmail.com" class="cremed">zeratul976@hotmail.com</a>> wrote:<br>

><br>
> Hello,<br>
><br>
> I am trying to use clang for the first time, on Ubuntu 10.04.<br>
><br>
> The default compiler on Ubuntu 10.04 is GCC 4.4, but I've built<br>
> GCC 4.7 from source and use it to compile C++11 programs.<br>
><br>
> Clang finds GCC 4.4's libstdc++ no problem, but I need it to<br>
> use GCC 4.7's libstdc++ because my program uses standard<br>
> library features that have been added between GCC 4.4 and 4.7.<br>
> How do I direct clang to find the 4.7 libstdc++?<br>
><br>
> I saw the following instructions on the "Get Started" page:<br>
><br>
> "If Clang cannot find your system libstdc++ headers, please<br>
> follow these instructions:<br>
>  - 'gcc -v -x c++ /dev/null -fsyntax-only' to get the<br>
>    path.<br>
>  - Look for the comment "FIXME: temporary hack:<br>
>    hard-coded paths" in clang/lib/Frontend/InitHeaderSearch.cpp<br>
>    and change the lines below to include that path"<br>
><br>
> Is that the only way? Having to recompile the compiler to get<br>
> it to find a different standard library seems a bit excessive...<br>
> shouldn't one be able to switch standard libraries without<br>
> recompiling the compiler?<br>
<br>
</div>Those comments are a bit out of date for linux.  You should be able to<br>
configure clang with --with-gcc-toolchain pointing to where you<br>
install g++ 4.7.</blockquote></div><br></div><div class="gmail_extra">Or if you install Clang alongside the gcc 4.7 installation, it should Just Work without any further action. We look adjacent to the clang binaries for a companion GCC installation specifically to support this (quite common) use case.</div>