[LLVMdev] Problem Linking Analysis Group

John Criswell criswell at cs.uiuc.edu
Mon Apr 7 13:54:55 PDT 2008


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.




More information about the llvm-dev mailing list