P
Pablo Santa Cruz
Hello all,
I am having runtime problems with a library (shared object) I am
making in Linux:
Distro: RedHat 9.0 (RH90)
Compiler: gnu gcc 3.2.2
I am linking the library correctly (I guess) because I can load the
library, execute functions in it and everything goes smoothly.
The problem begins when I execute a function that loads another
library with dlopen. When the dlopen call checks for symbols I get an
"undefined symbol" runtime error. If I load this library where I am
getting the runtime error directly (i.e. within an executable, not
another library) I get all symbols loaded correctly.
The undefined symbols I am getting are the ones defined in glib, and I
have glib and gnome working correctly in my RH system. Perhaps library
is not finding glib?
In other WORDS: my function that loads the library works in a program,
but not if it is part of other library.
Is there a special rule for this kind of action? What could I be doin'
wrong?
If it helps, I will copy "gcc" call that is performing the actual
linking:
=============
gcc -shared -Wl,--export-dynamic -fPIC -DPIC -o mylibrary.so *.o
-lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm
-lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0
-ldl -lglib-2.0 -L/usr/X11R6/lib -lSM -lICE -lX11 -lXext
-L/usr/X11R6/lib -lXss -L/usr/X11R6/lib -lSM -lICE -lnsl
=============
Tks a lot.
Cheers.
I am having runtime problems with a library (shared object) I am
making in Linux:
Distro: RedHat 9.0 (RH90)
Compiler: gnu gcc 3.2.2
I am linking the library correctly (I guess) because I can load the
library, execute functions in it and everything goes smoothly.
The problem begins when I execute a function that loads another
library with dlopen. When the dlopen call checks for symbols I get an
"undefined symbol" runtime error. If I load this library where I am
getting the runtime error directly (i.e. within an executable, not
another library) I get all symbols loaded correctly.
The undefined symbols I am getting are the ones defined in glib, and I
have glib and gnome working correctly in my RH system. Perhaps library
is not finding glib?
In other WORDS: my function that loads the library works in a program,
but not if it is part of other library.
Is there a special rule for this kind of action? What could I be doin'
wrong?
If it helps, I will copy "gcc" call that is performing the actual
linking:
=============
gcc -shared -Wl,--export-dynamic -fPIC -DPIC -o mylibrary.so *.o
-lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm
-lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0
-ldl -lglib-2.0 -L/usr/X11R6/lib -lSM -lICE -lX11 -lXext
-L/usr/X11R6/lib -lXss -L/usr/X11R6/lib -lSM -lICE -lnsl
=============
Tks a lot.
Cheers.