Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

plugin library problem - libstdc++ version

0 views
Skip to first unread message

sysak

unread,
Jan 13, 2005, 3:22:06 AM1/13/05
to
Hello,
I've got a problem with my plugin library.
OS: Linux RedHat, compiler: gcc.
Because I wrote this plugin in C++, it uses libstdc++.so.
Unfortunately the application that my plugin is written for
also uses libstdc++. There are conflicts of libstdc++ version.
Is there any solution for my problem besides using the same version
of gcc that the external application is compiled when I compile/link
my plugin library? Static linkage doesn't solve this problem.
Is there any way to enforce my plugin library to use functions from
proper libstdc++?

Kuba

Paul Pluzhnikov

unread,
Jan 13, 2005, 10:45:47 AM1/13/05
to
"sysak" <"sysak"@pf.pl> writes:

> Is there any solution for my problem besides using the same version
> of gcc that the external application is compiled when I compile/link
> my plugin library?

Yes; but using the same version of 'g++' is much simpler.

> Static linkage doesn't solve this problem.

Static linking *does* solve the problem, but in addition to linking
libstdc++.a into your plugin, you must also hide the symbols that
came from it.

This is best done with a linker version script which explicitly
exports whatever your plugin must export, and hides everything
else, e.g.:

$ cat Version
MyPlugin {
global: func1; func2; func3;
local: *;
};

Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.

sysak

unread,
Jan 18, 2005, 9:27:30 AM1/18/05
to
>>Static linkage doesn't solve this problem.
>
>
> Static linking *does* solve the problem, but in addition to linking
> libstdc++.a into your plugin, you must also hide the symbols that
> came from it.

hello,
thanks for your advice.
unfortunately it didn't help.
i managed to hide symbols that come from libstdc++.a (option
--retain-symbols-file) but it didn't solve my problem.
my plugin library didn't work anyway.
linker option -Bsymbolic helped.
it caused that my library didn't use any function from dynamic version
of libstdc++.
kuba

0 new messages