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

Han Wang wanghan02 at gmail.com
Wed Jul 8 06:33:22 PDT 2015


Hi,

I tried to install clang as in Getting started page
<http://clang.llvm.org/get_started.html>. But when I try to include the AST
Matcher header file like this in a simple cpp file,

#include "clang/ASTMatchers/ASTMatchers.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"

the compile crashed. There are error messages like this,

Undefined symbols for architecture x86_64:

  "llvm::RefCountedBaseVPTR::anchor()", referenced from:

      vtable for clang::ast_matchers::internal::matcher_isPublicMatcher in
removecolit-ffa5ed.o

      vtable for clang::ast_matchers::internal::matcher_isProtectedMatcher
in removecolit-ffa5ed.o

      vtable for clang::ast_matchers::internal::matcher_isPrivateMatcher in
removecolit-ffa5ed.o

      vtable for clang::ast_matchers::internal::matcher_isImplicitMatcher
in removecolit-ffa5ed.o

      vtable for
clang::ast_matchers::internal::matcher_ignoringImpCasts0Matcher in
removecolit-ffa5ed.o

      vtable for
clang::ast_matchers::internal::matcher_ignoringParenCasts0Matcher in
removecolit-ffa5ed.o

      vtable for
clang::ast_matchers::internal::matcher_ignoringParenImpCasts0Matcher in
removecolit-ffa5ed.o

      ...

  "llvm::APInt::initSlowCase(unsigned int, unsigned long long, bool)",
referenced from:

      llvm::APInt::APInt(unsigned int, unsigned long long, bool) in
removecolit-ffa5ed.o

Thanks very much!
Best regards,
Han
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150708/c7eed745/attachment.html>


More information about the cfe-dev mailing list