Hi
I have a project which uses shared object libraries.
There are other parts of the program which i must link statically.
When i link my program where the static parts are
linked directly as .o files, my program works correctly.
If i create a library (libKernel.a) from these object files,
and link the program with it, then the program fails with
an error message
1 2
|
Couldn't load library or extract symbols [./plugins/qhg_SpecialDynObj.so]:
./plugins/qhg_SpecialDynObj.so: undefined symbol: _ZN12AgentFactory13doCreateAgentEttf
|
Now the function "doCreateAgent" is in the library libKernel.a:
1 2
|
$ nm libKernel.a | grep doCreateAgent
00000000000001d0 T _ZN12AgentFactory13doCreateAgentEttf
|
And it looks exactly like the function the .so file is looking for:
1 2
|
$ nm ../plugins/qhg_VegDynObj.so | grep doCreateAgent
U _ZN12AgentFactory13doCreateAgentEttf
|
When i link my program with the library libKernel.a *and* the object file AgentFactory.o
then the linking succeeds (even though the functions of AgentFactory are linked in twice)
and furthermore the program runs correctly (i.e. no more "undefined symbol")
Can anybody explain this and help me getting it to run?
Thank You
Jody