undefined reference to typeinfo for clang::ASTFrontendAction

Hello cfe-dev,

trying to compile this simple code, but somehow it doesnt work. Can
somebody point me to what i'm missing.

#define __STDC_LIMIT_MACROS
#define __STDC_CONSTANT_MACROS

#include <clang/Frontend/CompilerInstance.h>
#include <clang/Frontend/FrontendAction.h>

class MyASTAction: public clang::ASTFrontendAction {
public:
protected:
       virtual clang::ASTConsumer*
CreateASTConsumer(clang::CompilerInstance &CI,
                       llvm::StringRef InFile) {
               return 0;
       }

private:
};

int main(int argc, const char** argv) {
       MyASTAction action;

       return 0;
}

**** Build of configuration Debug for project clangtest ****

make all
Building file: ../main.cpp
Invoking: GCC C++ Compiler
g++ -I/home/dima/Software/llvm-2.8/include -O0 -g3 -Wall -c
-fmessage-length=0 -MMD -MP -MF"main.d" -MT"main.d" -o"main.o"
"../main.cpp"
Finished building: ../main.cpp

Building target: clangtest
Invoking: GCC C++ Linker
g++ -L/home/dima/Software/llvm-2.8-dbg/lib -o"clangtest" ./main.o
-lclangFrontend -lclangSerialization -lclangDriver -lclangCodeGen
-lclangSema -lclangChecker -lclangAnalysis -lclangRewrite -lclangAST
-lclangParse -lclangLex -lclangBasic -lLLVMMC -lLLVMCore -lLLVMSupport
-lLLVMSystem -lpthread -ldl -lm
./main.o:(.rodata._ZTI11MyASTAction[typeinfo for MyASTAction]+0x10):
undefined reference to `typeinfo for clang::ASTFrontendAction'
collect2: ld returned 1 exit status
make: *** [clangtest] Fehler 1

The ASTFrontendAction class derives from FrontendAction, which has several pure virtual functions. Are you sure you have overridden all of them?

Eli

If i wouldn't then the compiler would say me, that it
can't instantiate an abstract class. But this is a linker error and i
dont know, what
i'm missing.

Hello again,

looks like i found what i was missing. I must compile with
the -fno-rtti option.

Cheers