Question about linker error

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
collect2: ld returned 1 exit status

GlobalExprAST class is:

/// GlobalExprAST - Expression class for globals
class GlobalExprAST : public ExprAST {
  std::string Name;
  ExprAST *Init;
  GlobalExprAST(const std::string &name, ExprAST *init)
  : Name(name), Init(init) {}

  virtual Value *Codegen();

/// Parser
/// ::= 'global' identifier ('=' expression)?
static ExprAST *ParseGlobalExpr() {

    std::string Name = IdentifierStr;

    ExprAST *Init = 0;
    if (CurTok == '=') {

      Init = ParseExpression();
      if (Init == 0) return 0;
  return new GlobalExprAST(Name, Init);

Any help would be much appreaciated!

Guessing here, but I think the Codegen method is a "key" method.
Normally the compiler emits weak definitions for things like inline
functions, vtables, and other data associated with the class
definition, but if it spots a key method definition, rather than
duplicating all that crap in every translation unit, it will trust
that whichever TU defines any key method will emit the vtable and the
rest of the data.

See if providing a definition of Codegen in a .cpp file fixes your problem.