How to use libclang with STL?

孤者浪人 提交于 2019-12-03 08:54:18

Since libclang was precompiled, it doesn't know about the exact paths of the standard libraries used by your compilers. You'll have to tell it about the standard include path using -I switches in your arguments list, when calling clang_parseTranslationUnit.

Here is the command I use to find about the inclusion paths for gcc on Linux. You should be able to adapt it to MinGW in your windows environment:

$ echo "" | g++ -v -x c++ -E -
...
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/4.8
 /usr/include/x86_64-linux-gnu/c++/4.8
 /usr/include/c++/4.8/backward
 /usr/lib/gcc/x86_64-linux-gnu/4.8/include
 /usr/local/include
 /usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
...
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!