[LLVMdev] Question about linker error
Anton Skvorts
anton.skvorts at gmail.com
Mon Feb 7 17:35:27 PST 2011
Hello all,
When extending the tutorial to support global variables I'm getting
the following linker error:
glob.o:glob.cpp:(.text+0x12241): undefined reference to `vtable for
GlobalExprAST'
collect2: ld returned 1 exit status
GlobalExprAST class is:
/// GlobalExprAST - Expression class for globals
class GlobalExprAST : public ExprAST {
std::string Name;
ExprAST *Init;
public:
GlobalExprAST(const std::string &name, ExprAST *init)
: Name(name), Init(init) {}
virtual Value *Codegen();
};
/// Parser
/// ::= 'global' identifier ('=' expression)?
static ExprAST *ParseGlobalExpr() {
getNextToken();
std::string Name = IdentifierStr;
getNextToken();
ExprAST *Init = 0;
if (CurTok == '=') {
getNextToken();
Init = ParseExpression();
if (Init == 0) return 0;
}
return new GlobalExprAST(Name, Init);
}
Any help would be much appreaciated!
Anton
More information about the llvm-dev
mailing list