[comp.sys.sun] Shared library problems

robert@nluug.nl (Robert de Vries) (05/17/89)

I am trying to convert the X libraries (X11, Xaw, Xt, Xmu, oldX) to shared
libs.  I have faithfully removed any global initialized variables from the
sources and put them in separate modules which went into the .sa part of
the library.  What is the problem:

ld seems to miss globals which are only referenced in the library itself.
Therefore I get a message 'ld.so: __qfree not found' when I start a
program compiled with -lX11.

When I link the executable using a command like:

cc -o exec exec.o /usr/lib/libX11.so.1.0 /usr/lib/libX11.sa.1.0

everything works fine.  When I exchange the last two files the program
aborts with the message above.  I figured that when I could create a
reference to _qfree linking would go fine.  Is this the solution? Or must
I forget the _qfree and not put it in the .sa file because it will never
be referenced outside the X library?  Or even better: concatenate all the
files referencing _qfree, make _qfree local, and put the whole bunch into
a .so file.

hart@decwrl.dec.com (Howard C. Hart) (05/31/89)

In article <723@dutrun.UUCP> duttnph!robert@nluug.nl (Robert de Vries) writes:
>X-Sun-Spots-Digest: Volume 7, Issue 300, message 10 of 15
>
>Therefore I get a message 'ld.so: __qfree not found' when I start a
>program compiled with -lX11.
>
>When I link the executable using a command like:
>
>cc -o exec exec.o /usr/lib/libX11.so.1.0 /usr/lib/libX11.sa.1.0
>
>everything works fine.  When I exchange the last two files the program
>aborts with the message above.  I figured that when I could create a

Hmmmm.... Looks suspiciously like the message I used to get when I called
some FORTRAN libraries out of order. This problem also fixed itself when I
made sure any subroutines called from one library were available in the
following library called from the command line. I.E. -
/usr/lib/libX11.sa.1.0 is calling a subroutine in /usr/lib/libX11.so.1.0.
Or maybe I just misunderstood the question?


Howard C. Hart                  UUCP:{sun!sunncal,pyramid}!leadsv!laic!nova!hart
Lockheed Missiles and Space Co.
Orgn 59-53, Bldg 593            Ph: (408) 743-2253 or -7353
Sunnyvale, CA 94086