[cfe-dev] Locating standard library when using -cc1

Sebastian Redl sebastian.redl at getdesigned.at
Sat Jul 14 13:47:22 PDT 2012


On 14.07.2012, at 22:07, Marco Craveiro wrote:

> Hi cfe-dev,
> 
> 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:
> 
> $ clang -cc1 -fsyntax-only hello.cpp 
> hello.cpp:1:10: fatal error: 'iostream' file not found
> #include <iostream>
>          ^
> 1 error generated.
> 
> But all is well with the GCC driver:
> 
> $ clang -fsyntax-only hello.cpp 
> $
> 
> I've tried adding -stdlib=libstdc++ but had no luck. How to I convince the clang compiler driver to find the GCC standard library?

clang -fsyntax-only hello.cpp -###

Then copy the clang -cc1 command this prints.

Sebastian





More information about the cfe-dev mailing list