[H-GEN] ld blues
Craig Eldershaw
ce at comlab.ox.ac.uk
Thu May 14 06:30:34 EDT 1998
Hi Doug,
>I'm currently working on writing native GTK stuff for java, but I've run
>into a small problem. I have created a library using GTK, but when I try
>to use the library, I get:
>
>/usr/local/lib/libgtk.so: undefined symbol: g_strcasecmp (libgtk.so)
>
>From what I can figure, g_strcasecmp is in libglib.so.
>
>When I use ld, I have the following flags set:
>
>-L/usr/local/lib -L/usr/X11R6/lib -lgtk -lgdk -lglib -lXext -lX11 -lm
>-shared
I held off replying since I don't have these libraries and so can't
check specifics. But as no one else has responded, then a general
answer:
Have you tried playing around with the program `nm' ? It will show you
what symbols are defined or required by any particukar library. Obviously
you are correct in that libgtk should come before the library which
suplies g_strcasecmp.
Try running the link line with a -v option in case it shows you
something odd (eg. picking up the file from an un-expected directory).
Also, if you have the static versions of the libraries, then try
replacing the '-lgtk -lgdk -lglib' with 'libgtk.a libgdk.a libglib.a'
(you may need to prepend paths to each). This will force *all* the
symbols in each to be kept and resolved (so order is no longer
important as it is with the current calling sequence).
Why are you using ld directly yourself, rather than relying upon gcc
(or whatever) to do it for you ? Try using it - it may add the
necessary magic ingredient that you accidentaly missed out.
Note: strcasecmp (not g_strcasecmp) is defined in libc. So you are
probably just after some sort of wrapper...unless you are using some
language which mangles its symbols.
Cheers,
Craig.
----------------------- HUMBUG General List --------------------------------
echo "unsubscribe general" | mail majordomo at humbug.org.au # To Unsubscribe
More information about the General
mailing list