<div class="gmail_extra"><div class="gmail_quote">On Sat, Apr 28, 2012 at 11:57 PM, Nathan Ridge <span dir="ltr"><<a href="mailto:zeratul976@hotmail.com" target="_blank">zeratul976@hotmail.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"><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>
> 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.<br>
<br>
</div>Thanks! I think the webpage should be updated to reflect this.<br>
I attached a patch.<br></blockquote><div><br></div><div>Can you mention that in general, Clang should automatically detect the best version of libstdc++ headers available and use them, and that it will look both for system installations of libstdc++ as well as installations adjacent to clang itself?</div>
<div><br></div><div>The --with-gcc-toolchain should really be a fallback for when the configuration is quite strange.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
Regards,<br>
Nate<br>
                                          <br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>