[LLVMdev] stdio.h cannot be found using Clang as a library

lipengcheng pli at cs.rochester.edu
Fri Jun 6 08:56:36 PDT 2014


Hi there,

I am now trying to use Clang as a library to analyze C/C++ programs.
I encountered a problem when dealing with header files. 

As you know, using clang needs my own consumer, action stuffs. And
it calls ParseAST function automatically during execution of my actions. Now the
problem happens when doing ParseAST. ParseAST cannot find out
the header file of "stdio.h", actually all header files except the ones in the 
current directory.  

Any solutions about this ? Thanks,

Say, we have a program as follows. After removing the header file declaration, 
it works. 

#include <stdio.h>
main()
{
    int a;
    a  = a + 1;
}

Best,
- Pengcheng



More information about the llvm-dev mailing list