RE: [gtk-list] Re: Undefined Symbol when compiling glib



I appreciate the response. You were right on the undefined symbols.
It seems the realllllly old version of gcc that I was using, 2.5.8 
has a problem on my platform with the standard optimization option.
I changed the CFLAG variable to -O and it compiled no problem. 

I got to compiling GTK and got another unreferenced symbol

----------------------------------------------------------------------------
--------------

        /bin/sh ../libtool --mode=link gcc  -O -Wall  -o testgtk  testgtk.o
libgtk.la        ../gdk/libgdk.la           -L/usr/lib
-lXext -lX11                 -L/home/dbaggett/glib/lib -lgmodule -lglib -ldl
-lm                   
gcc -O -Wall -o .libs/testgtk testgtk.o .libs/libgtk.so
-L/home/dbaggett/glib/lib -lgmodule -lglib -ldl -L/usr/lib -lXext -lX11 -lm
../gdk/.libs/libgdk.so -lgmodule -lglib -ldl -lXext -lX11 -lm -L/usr/lib
-lXext -lX11 -L/home/dbaggett/glib/lib -lgmodule -lglib -ldl -lm
-L/home/dbaggett/gtk/lib
Undefined                       first referenced
 symbol                             in file
_iswctype                           .libs/libgtk.so
ld: .libs/testgtk: fatal error: Symbol referencing errors. No output written
to .libs/testgtk
*** Error code 1

Stop.
*** Error code 1

Stop.
*** Error code 1

Stop. 
----------------------------------------------------------------------------
----------------

If my memory is correct, (and please excuse me, I haven't done much C which
is why
I am muddling through this) :)

I could not find the above function within the source code ( having greped
it)
so I was thinking it got called somehow implicitly. Would you have any
suggestions?



-----Original Message-----
From: Allan Black [mailto:allan@genia.scotnet.co.uk]
Sent: Thursday, February 03, 2000 9:16 AM
To: gtk-list@redhat.com
Subject: [gtk-list] Re: Undefined Symbol when compiling glib


> I've encountered a problem compiling glib 1.2.6 under 
[...]
> gcc -g -O2 -Wall -o .libs/testglib testglib.o .libs/libglib.so
> -L/usr/local/lib
> Undefined                       first referenced
>  symbol                             in file
> .L_E1366                            .libs/libglib.so
> .L_E1367                            .libs/libglib.so
> .L_E1368                            .libs/libglib.so
> ld: .libs/testglib: fatal error: Symbol referencing errors. No output
> written to .libs/testglib

I have, in the past, had similar problems trying to compile code on older
versions of Solaris. I eventually tracked it down to one of the arguments
to ld ....

	ld [other args] -z text [other args]

The Solaris man page for ld says:

     -z text     In dynamic mode only, force a fatal error if any
		 relocations  against  non-writable,  allocatable
		 sections remain.

I don't know what "non-writeable, allocatable sections" are, but I
definately believe the bit about the fatal error :-)

I worked around it by hacking libtool (after running ./configure) and
removing -z text from the appropriate variable.

The above undefined symbols are, if memory serves me correctly, of the
form used by the compiler as internal labels, either for local variables
or for the destinations of short branches (i.e. a few instructions long).
I suspect that the compiler is creating these symbols during an early pass,
the optimiser is removing small sections of code, or unused variables, but
the symbol is still in the symbol table. Sound reasonable? (Oh **** just
try it and see if it works :-)

Allan

-- 
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]