Guillaume Rousse <[EMAIL PROTECTED]> writes:

> Ainsi parlait Guillaume Cottenceau :
> > Guillaume Rousse <[EMAIL PROTECTED]> writes:
> > > [guillaume@agathe guillaume]$ xmms
> > > /usr/lib/xmms/Input/libcdread.so: undefined symbol: playlist_position
> > >
> > > Maybe just a package rebuild should suffice ?
> >
> > yes. contrib/lenny..
> I just tried by myself, it seems not enough :-(
> [guillaume@agathe guillaume]$ xmms
> /usr/lib/xmms/Input/libcdread.so: undefined symbol: playlist_position
> 
> Why does this error arise at runtime, while compilation was OK ? I thought 
> late binding was an OO feature ?

The thing is that separated compilation with appropriate headers, and
final linkage, are two different things.

You have to think of creation of shared object more like creation of
object file (e.g. with undefined symbols) rather than creation of
binaries.

Linkage of shared objects is done when the shared objects are loaded.


No problem:

[gc@obiwan ~/cvs/gi/mdk-stage1] cat > t.c
int kloug();
int func() {
  kloug();
}
[gc@obiwan ~/cvs/gi/mdk-stage1] gcc -shared t.c -o plop.so
[gc@obiwan ~/cvs/gi/mdk-stage1] objdump -x plop.so  | grep kloug
00000000         *UND*  00000000              kloug


Problem:

[gc@obiwan ~/cvs/gi/mdk-stage1] LD_PRELOAD=./plop.so ls
ls: error while loading shared libraries: ./plop.so: undefined symbol: kloug


-- 
Guillaume Cottenceau

Reply via email to