Hi:<br>   I'm using clang3.6, first time I use compilerInstance+ParseAST to operate AST.When the sourcefile have an fatal error:'stdio.h' file not found. Second time I use compilerInvocation+ASTUnit to operate AST.It have the same problem.<br>the source of compilerInvocation+ASTUnit( parse the ast of c)<br>  int main(int argc, char** argv)<br>{<br>    shared_ptr<ASTUnit> AST;<br>        clang::DiagnosticOptions diagOpts;<br>        llvm::IntrusiveRefCntPtr<clang::DiagnosticsEngine> diags = clang::CompilerInstance::createDiagnostics(&diagOpts, 0, 0);<br>        clang::LangOptions lopt;<br>        vector<const char*> argvec;<br>        argvec.push_back("clang");<br>        argvec.push_back("-fsyntax-only");<br>        argvec.push_back(argv[1]);    //it's the filename<br>        ArrayRef<const char *> args(argvec);<br>        CompilerInvocation *ci = new clang::CompilerInvocation();<br>        CompilerInvocation::CreateFromArgs(*ci,&argvec[0],&argvec[0]+1,*diags);<br>        ci->setLangDefaults(lopt,InputKind::IK_C);<br>        llvm::outs()<<"createinvocationfromcommandline"<<"\n";<br>        ci->getPreprocessorOutputOpts().ShowComments = 1;<br>        ci->getPreprocessorOutputOpts().ShowLineMarkers = 1;<br>        llvm::outs()<<"preprocessor init "<<"\n";<br>        AST = clang::ASTUnit::LoadFromCompilerInvocation(ci, diags);<br>        llvm::outs()<<"createAST"<<"\n";<br>        MyASTVisitor myvis;<br>        myvis.TraverseDecl(AST->getASTContext().getTranslationUnitDecl());<br>}<br>what i miss? I don't know how to correctly create object of CompilerInvocation,I think it's because i don't correctly new the compilerinvocation.<br>Thank you so much!<br><br>by YingLi<br>