PDA

View Full Version : Using symbols from loading application in shared library



barteksch
19th November 2010, 18:02
Hi

I'm developing an application and I want to extend it with shared library.
Library have to access application's symbols to modify QTreeWidget (which is a member of application) and there's a problem. I pass tree widget pointer to library using class constructor and store it in variable, but every time I start application I get undefined symbol or segmentation fault error. So my question is: is there any possibility of passing symbols to shared library? Or maybe there is programming philosophy of doing such things?

PS. Both, library and application, compiles without problem. And when I use "nm -D library.so" it shows symbol which I'm looking for.

PS2. Sorry for any language mistakes, I'll explain anything if it is needed.

Platform: Ubuntu 10.10 64bit
Qt: 4.7 64bit

tbscope
19th November 2010, 18:08
undefined symbol or segmentation fault error

Without changing the code it would be one or the other, not both.
Since you say the symbols can be found, I guess the main problem is a segmentation fault?

If so, it might be a simple pointer error.

Can you post a compilable and minimal example demonstrating the problem?