开发者社区 问答 正文

clang parseast,include file not found?报错

我用compilerinstance+parseAST解析C源码的AST时,如果源文件中有include,就报错fatal error:'stdio.h' file not found.


我想是HeaderSearchOption没有操作好,但是我不知道该怎么操作

展开
收起
爱吃鱼的程序员 2020-06-14 16:27:28 581 分享 版权
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    searchDir搞定没有您知道怎么设置searchDir吗?还要看你的clang是什么平台,制定-I之类的参数。lib/Frontend/InitHeaderSearch.cpp你解析源码要把include的文件也处理。

    2020-06-14 16:27:44
    赞同 展开评论
问答分类:
问答地址: