[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: c++ dlopen plugin --> returns undefined symbol
From: |
Timothy Baldwin |
Subject: |
Re: c++ dlopen plugin --> returns undefined symbol |
Date: |
Tue, 24 Jul 2007 11:21:29 +0100 |
User-agent: |
KNode/0.10.5 |
In message <f6li1g$jav$00$1@news.t-online.com>, Thomas Drillich
<th@drillich.com> wrote:
> Hi
>
> I'm trying to run the C++ dlopen example from
> http://www.linux.org/docs/ldp/howto/C++-dlopen/thesolution.html.
> but I always get the error message
> "Cannot load library: .libs/libtriangle.so: undefined symbol:
> _ZTI7Polygon"
>
> I see that the compiler renames the >Polygon< class, the >Polygon< class
> is defined in a header file and included in main-program and plugin-lib.
Are you sure you haven't added a non-inline virtual function to the Polygon
class?
> But it seems that the compiler creates different symbol names each time.
It shouldn't do that.
> g++ -O0 -g3 -o cpp_dlopentest cpp_dlopentest.o -ldl
You should pass -rdynamic when linking the main program so that the plugin
can refer to symbols in main program.
--
OpenPGP key fingerprint: D0A6 F403 9745 CED4 6B3B 94CC 8D74 8FC9 9F7F CFE4