Problem Linking Analysis Group

Dear All,

I'm having the following problem linking code that defines and uses an AnalysisGroup.

I have an analysis group defined as follows:

class PoolAllocateGroup {
public:
  static char ID;
  virtual ~PoolAllocateGroup ();
  virtual PA::FuncInfo *getFuncInfo(Function &F);
  ...
};

... which is then inherited by a ModulePass:

class PoolAllocate : public ModulePass , public PoolAllocateGroup {
...

};

... which is then inherited by another pass:

class PoolAllocateSimple : public PoolAllocate {
...
}

When I compile the code into a dynamically linked library, everything is fine. However, when I try to link that dynamic library into a program in another project, I get the following error:

/localhome/criswell/llvm22/projects/llvm-poolalloc/Debug/lib/libpoolalloc.so: undefined reference to `vtable for llvm::PoolAllocateGroup'
/mounts/maute/disks/0/criswell/llvm22/projects/safecode/Debug/lib/libpointerchecks.so: undefined reference to `typeinfo for llvm::PoolAllocateGroup'

Does anyone know what I might be doing wrong?

Thanks in advance.

-- John T.

The usual answer, you need to define all virtual functions, in particular, those in the PoolAllocateGroup hierarchy.

Mike Stump wrote:

  

/localhome/criswell/llvm22/projects/llvm-poolalloc/Debug/lib/
libpoolalloc.so:
undefined reference to `vtable for llvm::PoolAllocateGroup'
    
Does anyone know what I might be doing wrong?
    
The usual answer, you need to define all virtual functions, in
particular, those in the PoolAllocateGroup hierarchy.
  

That fixed it.

Thanks!

-- John T.