calling a function of a shared library from another shared library

Benjamin Raverdy b.raverdy@alamaison.fr
Thu Jan 5 17:57:00 GMT 2012


Hi,

I have a main application (lmApplication) (compiled with the -rdynamic 
option) calling a dynamically shared lirbary, that is calling back 
lmFromCaller() that belong to lmApplication.
lmApplication --------------------------------> lmLib.so
                    dyn load with dlopen           |
                                                   |
LmFromCaller() <-----------------------------------
As I use rdynamic, that works fine.

Now I want to do something similar, but having a shared library 
lmPlugin.so instead of the main application.
Hence I have a main application (lmApplication) calling a dynamically 
shared lirbary lmPlugin.so.
This plugin is itself calling another shared library lmLib.so that calls 
the method LmFromCaller() of lmPlugin.so

lmApplication  --------> lmPlugin.so ------------------------> lmLib.so
          dyn load with dlopen      dyn load with dlopen           |
                                                                   |
                        lmFromCaller() <----------------------------

I get an error, spite I compiled everything with the -rdynamic option:
./test: symbol lookup error: 
/home/benjaminr/Desktop/example_dynamic_load/LmLib/Debug/liblmLib.so: 
undefined symbol: _Z32lmFromCallerv

If you would find it useful to understand my attempts, I can give you 
the code and the way I compiled it.

Regards,

(Sorry I have posted this on other places in the gcc mailing lists 
before finding this one)


-- 
Benjamin Raverdy

VFX software engineer
La Maison
13-15 rue Gaston Latouche
92 210 Saint-Cloud. France
email: b.raverdy@alamaison.fr
phone: 01.41.12.20.27



More information about the Gcc-help mailing list