我想一切都在标题里^^ 事实上,我正在使用 libtooling 开发一个工具,但我想抑制所有错误(该工具旨在仅在正确的源上使用,因此错误输出会污染 stderr...)。
最佳答案
标题是libclang/libtooling,这里是libclang的答案。像这样创建你的 CXIndex
:
bool excludeDeclarationsFromPCH = false;
bool displayDiagnostics = false;
CXIndex index = clang_createIndex((int)excludeDeclarationsFromPCH, (int)displayDiagnostics);
参见 documentation .
关于c++ - libclang/libtooling 处理或关闭所有错误输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23343568/