Problem Linking Analysis Group

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem Linking Analysis Group

John Criswell
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.

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Problem Linking Analysis Group

Mike Stump
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.
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Problem Linking Analysis Group

John Criswell
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
> [hidden email]         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>  

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev