Bug 18356 - Undefined references with libX11.so and egcs++
Undefined references with libX11.so and egcs++
Product: Red Hat Linux
Classification: Retired
Component: egcs (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Depends On:
  Show dependency treegraph
Reported: 2000-10-04 15:21 EDT by Need Real Name
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2000-10-04 15:21:41 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Need Real Name 2000-10-04 15:21:38 EDT
Under RH7.0, some of my old programs do not compile with the new gcc/g++
(2.96), so I installed compat-egcs and compat-egcs++ and dependencies. With
egcs++, however, I get some unresolved symbols in libX11.so (X4).

509) silviu:~/WORK/TOOLS> egcs++ -v
Reading specs from /usr/lib/gcc-lib/i386-glibc21-linux/egcs-2.91.66/specs
gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)

508) silviu:~/WORK/TOOLS> make CC=egcs++ tango
(cd GYPSY; make libgypsy)
make[1]: Entering directory `/home/silviu/WORK.10.4/GYPSY'
ar r libgypsy.a foveate.o grid.o gypsy.o utils.o cblock.o cgrid.o \
grab.o indexx.o
mv libgypsy.a /home/silviu/WORK/lib
make[1]: Leaving directory `/home/silviu/WORK.10.4/GYPSY'
(cd PGM; make libpgm)
make[1]: Entering directory `/home/silviu/WORK.10.4/PGM'
ar r libpgm++.a pgm.o fov.o dct.o edge.o blob.o realfft.o clog.o ppm.o
mv libpgm++.a /home/silviu/WORK/lib
make[1]: Leaving directory `/home/silviu/WORK.10.4/PGM'
egcs++ -o tango -g -Wall -L/home/silviu/WORK/lib -L/usr/X11R6/lib -IPGM
-IGYPSY -I/usr/X11R6/include `imlib-config --cflags-gdk` tango.o swin.o
-lX11 -lgypsy -lpgm++    
/usr/X11R6/lib/libX11.so: undefined reference to `getpwuid_r@GLIBC_2.1.2'
/usr/X11R6/lib/libX11.so: undefined reference to `shmctl@GLIBC_2.2'
/usr/X11R6/lib/libX11.so: undefined reference to `getpwnam_r@GLIBC_2.1.2'
collect2: ld returned 1 exit status
make: *** [tango] Error 1

All is well if I compile this program with g++-2.96, but then, as I
mentioned above, there are other programs that do not compile with g++.
Comment 1 Jakub Jelinek 2000-10-05 01:38:26 EDT
First of all, I'd be interested in bugzilla reports about apps which
you are not able to build with gcc 2.96 (unless it is an obvious
error in the package, like lyx), best with all relevant details.
Second, if you're using egcs++, then you either have to make
sure -L/usr/lib is on the command line, or -L/usr/i386-glibc21-linux/lib/
is given before -L/usr/X11R6/lib, or compat-libs and compat-glibc
packages are not installed.
The issue is that egcs++ adds -L/usr/i386-glibc21-linux/lib internally
to search path, so that binaries built with it can be run on RH 6.x.
But if libc is picked from that directory (there is a RH 6.x glibc),
you need to make sure libX11 is picked from there as well, because you
cannot mix X11 libraries linked against glibc 2.1.9x with glibc 2.1.3.
Look at kde1 src.rpms in the distribution, they are also compiled
with egcs++ (because KDE1 does not follow C++ standards too closely)
and they make sure the libraries match.

Note You need to log in before you can comment on or make changes to this bug.