[cfe-dev] How to use AST Matchers without using ninja?

Douglas Katzman dougk at google.com
Wed Jul 8 10:45:07 PDT 2015


Sounds like you're not linking against the necessary libraries, and you
didn't add "-fno-rtti" to the cc command.

Try compiling this minimal 'foo.cpp' program:

#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/ASTMatchers/ASTMatchers.h"
int main() { return 0; }

% g++ -fno-rtti -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS
-D__STDC_LIMIT_MACROS -std=c++11 -g -Iinclude -Itools/clang/include
-I../src/include -I../src/tools/clang/include -c foo.cpp

% g++ -o foo foo.o \
  ../build/lib/libclangAST.a \
  ../build/lib/libclangASTMatchers.a \
  ../build/lib/libclangLex.a ../build/lib/libclangBasic.a \
  ../build/lib/libLLVMSupport.a \
  -lpthread -ldl -lncurses
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150708/911ee69b/attachment.html>


More information about the cfe-dev mailing list