question about -ccl option

Hi,

i am very new to clang so if there is documentation i overlooked please point me to it. My question relates to the ‘ccl’ option as i am trying to print the Abstract Syntax Tree

I build from source:
clang version 3.3 (trunk 179161)
Target: x86_64-unknown-linux-gnu
Thread model: posix

For a regular ‘Hello World’ program:
#include
int main() {
std::cout << “Heloo World!”;
return 0;
}

I can do: ~/clang/svn/build/Debug+Asserts/bin/clang++ -c HelloWorld.cpp

without any problems

When i do:
~/clang/svn/build/Debug+Asserts/bin/clang++ -cc1 -ast-dump-xml HelloWorld.cpp

it throws an error:
HelloWorld.cpp:1:10: fatal error: ‘iostream’ file not found
#include

I guess i am trying to understand why that is? I figure it knows the include paths since 1) works?

thanks,
matt

Hi,

Did you try adding -xc++ on the command line?
I’m also new to the list, but I think I saw sometime this issue when it “forgot” that it was compiling C++ and so lost the C++ include folders.

Matthieu

It is explained here:

http://clang.llvm.org/docs/FAQ.html#i-run-clang-cc1-and-get-weird-errors-about-missing-headers

Dmitri