[cfe-dev] Running clang programmatically

Stefan Seefeld stefan.seefeld at gmail.com
Thu Mar 18 06:59:32 PDT 2010


I still have trouble running clang programmatically, and I'm not quite 
sure what goes wrong. I have attached a minimal test case demonstrating 
the problem:

I compiled it as "g++ -o clang clang.cc -lCIndex", then invoke that on a 
little test C++ input, via "./clang test.cc".

I then attempt to print the location of the first traversed cursor, but 
get nonsense. (The reported cursor type also seems incorrect, as I get a 
CXCursor_StructDecl, with an input file not containing any struct.)

Can anybody please help me figure out what I'm doing wrong ?

Thanks,
         Stefan

-- 

       ...ich hab' noch einen Koffer in Berlin...




More information about the cfe-dev mailing list