Daniel,<div><br></div><div>Many thanks for the prompt reply. This was extremely useful, I managed to get my simple hello world to compile and to provide me with accurate code completion. However, when I try the same trick with real code things don't go so well. The steps I performed were:</div>
<div><br></div><div>- run using the GCC driver with your -### argument: clang -fsyntax-only XYZ -###. All good.</div><div>- copy the entire command line returned and run it: all good.</div><div>- add -code-completion-at=XYZ to the command line: not so good.</div>
<div><br></div><div>I basically get lots and lots (and lots) of STL errors such as:</div><div><br></div><div><div>/usr/bin/../lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/bits/alloc_traits.h:56:35: error: </div>
<div>      in-class initializer for static data member is not a constant expression</div><div>      static const bool __value = _S_chk<_Alloc, _Tp>(nullptr);</div><div>                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~</div>
<div><br></div><div>These error does not appear to be triggered when I'm not using -code-completion-at. They also do not appear with -code-completion-at and my simple hello world, but, admittedly, the real code includes a fair chunk of the standard library as opposed to the hello world which only includes iostream.</div>
<div><br></div><div>Cheers</div><div><br></div><div>Marco</div><br><div class="gmail_quote">On 14 July 2012 21:22, Daniel Powell <span dir="ltr"><<a href="mailto:d.c.powell@sms.ed.ac.uk" target="_blank">d.c.powell@sms.ed.ac.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi<div class="im"><br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>I've installed llvm/clang 3.1 on my debian testing box and I must say its working pretty well. I decided to be braver and use the completion mode in emacs, which, if I understood things correctly, relies on the clang compiler driver. The problem I have is that when I use the clang compiler driver I it doesn't seem to be able to locate the standard library:</div>


</blockquote></div></div><p>I ran into this issue myself a bit ago. I solved it by compiling 
normally (without -cc1) and use the -### argument. This will list the full commands used 
at compile time, including the arguments loading the standard library locations. I
 think it was the -internal-isystem and -internal-externc-isystem arguments you want to look out for, but there could be others.<br></p>

<p>Hope that helps,</p>
<p>Dan</p><span class="HOEnZb"><font color="#888888"><br clear="all"><br>-- <br>--------<br>Daniel Powell<br><a href="mailto:d.c.powell@sms.ed.ac.uk" target="_blank">d.c.powell@sms.ed.ac.uk</a><br><a href="http://tinyurl.com/powelld" target="_blank">http://tinyurl.com/powelld</a><br>

<br>The University of Edinburgh<br>Institute for Computer Systems Architecture<br><br><br>
</font></span><br>The University of Edinburgh is a charitable body, registered in<br>
Scotland, with registration number SC005336.<br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>So young, and already so unknown -- Pauli<br><br>blog: <a href="http://mcraveiro.blogspot.com" target="_blank">http://mcraveiro.blogspot.com</a><br>
</div>