Shared lib problem - Linux
This is a discussion on Shared lib problem - Linux ; Hi everybody,
I'm trying to use Shared Library in my code. I have compiled sources
into
shared library but when I'm trying to open this library with dlopen I
get
the folowing error:
undefined symbol: __cxa_pure_virtual
If I understand correctly ...
-
Shared lib problem
Hi everybody,
I'm trying to use Shared Library in my code. I have compiled sources
into
shared library but when I'm trying to open this library with dlopen I
get
the folowing error:
undefined symbol: __cxa_pure_virtual
If I understand correctly the abstract virtual method stub is not
found. Why
is that happenning and what should I do to get through with it?
Thanks in advance.
-
Re: Shared lib problem
On Jun 14, 5:30 am, Maxim wrote:
> Hi everybody,
>
> I'm trying to use Shared Library in my code. I have compiled sources
> into
> shared library but when I'm trying to open this library with dlopen I
> get
> the folowing error:
>
> undefined symbol: __cxa_pure_virtual
>
> If I understand correctly the abstract virtual method stub is not
> found. Why
> is that happenning and what should I do to get through with it?
>
If a class contains abstract virtual method, it must be inherited and
provide the implementation of that virtual method, otherwise how
compiler find the machine code when someone calls this function?
-
Re: Shared lib problem
Thanks for reply Bin.
I should say that this library was originally compiled to static
library and that worked fine. So I think there's no problem with
abstract method inheritance. Actually I think that this problem has
nothing to do with calling abstract methods.
I'm new to Linux and gcc/g++, but I think that it's abstract method
implementation is the same as for Visual C++ and Borland C++ in MS
world.
I mean that if the method is abstract and it is being called, some
sort of the stub function is called instead. This function is called
for all abstract methods and stops program execution with some error
message.
I think that the problem is that this abstract stub was not linked
into shared library. I just don't know how can I find which library
this method is in. If you can give me some advices or hints here that
would be great.
On 14 , 03:13, Bin Chen wrote:
> On Jun 14, 5:30 am, Maxim wrote:> Hi everybody,
>
> > I'm trying to useSharedLibraryin my code. I have compiled sources
> > into
> >sharedlibrarybut when I'm trying to open thislibrarywith dlopen I
> > get
> > the folowing error:
>
> > undefined symbol:__cxa_pure_virtual
>
> > If I understand correctly the abstract virtual method stub is not
> > found. Why
> > is that happenning and what should I do to get through with it?
>
> If a class contains abstract virtual method, it must be inherited and
> provide the implementation of that virtual method, otherwise how
> compiler find the machine code when someone calls this function?