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.
On Apr 7, 2008, at 1:54 PM, John Criswell 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.
Mike Stump wrote:> On Apr 7, 2008, at 1:54 PM, John Criswell 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.> _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >
Maybe Matching Threads
- [LLVMdev] Problem Linking Analysis Group
- [LLVMdev] Question about using steensgaard's pointer analysis in poolalloc
- [LLVMdev] Question about using steensgaard's pointer analysis in poolalloc
- [LLVMdev] Fwd: Question about using steensgaard's pointer analysis in poolalloc
- [LLVMdev] poolallocation error