Linker problem?

  • Thread starter Pablo Santa Cruz
  • Start date
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.
 
P

Pieter Droogendijk

On 8 Sep 2003 03:25:42 -0700
Hello all,

I am having runtime problems with a library (shared object) I am
making in Linux:

Linux is off-topic. comp.unix.programmers.
Distro: RedHat 9.0 (RH90)

Irrelevant information.
Compiler: gnu gcc 3.2.2

Compilers are off-topic. comp.compilers.

<SNIP> <SNIP> <SNIP>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top