We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

X lib errors

muesli
muesli asked
on
Medium Priority
926 Views
Last Modified: 2013-12-15
Hi,

I get lots of errors like the following when trying to compile the example KDE programs:

/usr/X11R6/lib/libXext.a(extutil.o): In function `XextAddDisplay':
extutil.o(.text+0x1e8): undefined reference to `_XLockMutex_fn'
extutil.o(.text+0x1f2): undefined reference to `_Xglobal_lock'
extutil.o(.text+0x20b): undefined reference to `_XUnlockMutex_fn'
extutil.o(.text+0x215): undefined reference to `_Xglobal_lock'


And, when trying to execute 'java' from the jdk1.1.6v2glibc, I get the following error:

/usr/local/jdk/bin/i586/green_threads/java: error in loading shared libraries
/usr/X11R6/lib/libXp.so.6: undefined symbol: _Xglobal_lock


I'd appreciate any help saying what the problem is, or advising what I should do to check my system out.  Like,
what do these messages exactly mean?  What tool can I use to find out what doesn't exist or is outdated, or has a broken dependency?

Here are the results of running "ldd" on the two named libraries.  (I'm not sure exactly what the results mean):

>ldd /usr/X11R6/lib/libXp.so.6
        libc.so.6 => /lib/libc.so.6 (0x4000a000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00000000)
> ldd /usr/X11R6/lib/libXext.a
ldd: warning: you do not have execution permission for `/usr/X11R6/lib/libXext.a'
        not a dynamic executable



My system:
Redhat i386 5.0

...Plus, I've upgraded several *lib* rpms.

Thanks.
Comment
Watch Question

> In function `XextAddDisplay':

   add -lXext to the link command line

for the other undefs try to find in which lib they are:

   foreach l (/usr/X11R6/lib/lib*)
     echo $lib; nm -gop $lib | grep Xglobal_lock
   end


> /usr/local/jdk/bin/i586/green_threads/java: error in loading shared libraries

please post the output of:

    ldd /usr/local/jdk/bin/i586/green_threads/java

Author

Commented:
Hi,

Thanks for the advice. Here's what I've done so far:

1)  Your advice helped me solved the problem with compiling the KDE code.  -lXext was already being used, so I ran your script - it found that the symlink for libXext was pointing to a nonexistent file.  After fixing the link, the code compiles.  Awesome.  Here is the current output of the script, fyi:
foreach lib (/usr/X11R6/lib/lib*)
foreach? echo $lib; nm -gop $lib | grep Xglobal_lock
foreach? end
/usr/X11R6/lib/libFS.a
/usr/X11R6/lib/libICE.a
/usr/X11R6/lib/libICE.so
/usr/X11R6/lib/libICE.so.6
/usr/X11R6/lib/libICE.so.6.0
/usr/X11R6/lib/libPEX5.a
/usr/X11R6/lib/libPEX5.so
/usr/X11R6/lib/libPEX5.so.6
/usr/X11R6/lib/libPEX5.so.6.0
/usr/X11R6/lib/libSM.a
/usr/X11R6/lib/libSM.so
/usr/X11R6/lib/libSM.so.6
/usr/X11R6/lib/libSM.so.6.0
/usr/X11R6/lib/libX11.a
/usr/X11R6/lib/libX11.a:Quarks.o:         U _Xglobal_lock
/usr/X11R6/lib/libX11.a:ConnDis.o:         U _Xglobal_lock
/usr/X11R6/lib/libX11.a:ErrDes.o:         U _Xglobal_lock
/usr/X11R6/lib/libX11.a:ErrHndlr.o:         U _Xglobal_lock
/usr/X11R6/lib/libX11.a:XlibInt.o:00000004 D _Xglobal_lock
/usr/X11R6/lib/libX11.a:locking.o:         U _Xglobal_lock
/usr/X11R6/lib/libX11.so
/usr/X11R6/lib/libX11.so.6
/usr/X11R6/lib/libX11.so.6.1
/usr/X11R6/lib/libXIE.a
/usr/X11R6/lib/libXIE.so
/usr/X11R6/lib/libXIE.so.6
/usr/X11R6/lib/libXIE.so.6.0
/usr/X11R6/lib/libXau.a
/usr/X11R6/lib/libXaw.a
/usr/X11R6/lib/libXaw.so
/usr/X11R6/lib/libXaw.so.6
/usr/X11R6/lib/libXaw.so.6.1
/usr/X11R6/lib/libXaw3d.so.6
/usr/X11R6/lib/libXaw3d.so.6.1
/usr/X11R6/lib/libXdmcp.a
/usr/X11R6/lib/libXdpms.a
/usr/X11R6/lib/libXext.a
/usr/X11R6/lib/libXext.a:extutil.o:         U _Xglobal_lock
/usr/X11R6/lib/libXext.so
/usr/X11R6/lib/libXext.so.6
/usr/X11R6/lib/libXext.so.6.1
/usr/X11R6/lib/libXi.a
/usr/X11R6/lib/libXi.so
/usr/X11R6/lib/libXi.so.6
/usr/X11R6/lib/libXi.so.6.0
/usr/X11R6/lib/libXintl.so
/usr/X11R6/lib/libXintl.so.6
/usr/X11R6/lib/libXintl.so.6.1
/usr/X11R6/lib/libXmu.a
/usr/X11R6/lib/libXmu.so
/usr/X11R6/lib/libXmu.so.6
/usr/X11R6/lib/libXmu.so.6.0
/usr/X11R6/lib/libXp.a
/usr/X11R6/lib/libXp.a:XpExtUtil.o:         U _Xglobal_lock
/usr/X11R6/lib/libXp.a:XpLocale.o:         U _Xglobal_lock
/usr/X11R6/lib/libXp.so
/usr/X11R6/lib/libXp.so:         U _Xglobal_lock
/usr/X11R6/lib/libXp.so.6
/usr/X11R6/lib/libXp.so.6:         U _Xglobal_lock
/usr/X11R6/lib/libXp.so.6.2
/usr/X11R6/lib/libXp.so.6.2:         U _Xglobal_lock
/usr/X11R6/lib/libXpm.so
/usr/X11R6/lib/libXpm.so.4
/usr/X11R6/lib/libXpm.so.4.10
/usr/X11R6/lib/libXpm.so.4.8
/usr/X11R6/lib/libXss.a
/usr/X11R6/lib/libXt.a
/usr/X11R6/lib/libXt.so
/usr/X11R6/lib/libXt.so.6
/usr/X11R6/lib/libXt.so.6.0
/usr/X11R6/lib/libXtst.a
/usr/X11R6/lib/libXtst.so
/usr/X11R6/lib/libXtst.so.6
/usr/X11R6/lib/libXtst.so.6.1
/usr/X11R6/lib/libXxf86dga.a
/usr/X11R6/lib/libXxf86misc.a
/usr/X11R6/lib/libXxf86vm.a
/usr/X11R6/lib/liboldX.a
/usr/X11R6/lib/libxkbfile.a
/usr/X11R6/lib/libz.a


2) Executing the command on the Java executable gives the following output:
ldd /usr/local/jdk/bin/i586/green_threads/java
        libjava.so => not found
        libm.so.6 => /lib/libm.so.6 (0x40003000)
        libdl.so.2 => /lib/libdl.so.2 (0x4001c000)
        libawt.so => not found
        libXpm.so.4 => /usr/X11R6/lib/libXpm.so.4 (0x40020000)
        libXt.so.6 => /usr/X11R6/lib/libXt.so.6 (0x4002d000)
        libICE.so.6 => /usr/X11R6/lib/libICE.so.6 (0x4007c000)
        libSM.so.6 => /usr/X11R6/lib/libSM.so.6 (0x40090000)
        libXp.so.6 => /usr/X11R6/lib/libXp.so.6 (0x40099000)
        libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x400a0000)
        libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x400ac000)
        libc.so.6 => /lib/libc.so.6 (0x40166000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00000000)
        libdl.so.1 => /lib/libdl.so.1 (0x4020a000)
        libXintl.so.6 => /usr/X11R6/lib/libXintl.so.6 (0x4020f000)

.By using locate, I found the directory that libjava.so, etc are in (/usr/local/jdk1.1.6/lib/i586/green_threads), added it to /etc/ld.so.conf, and ran ldconfig.  The output of ldd now looks better:
ldd /usr/local/jdk/bin/i586/green_threads/java
        libjava.so => /usr/local/jdk1.1.6/lib/i586/green_threads/libjava.so (0x40003000)
        libm.so.6 => /lib/libm.so.6 (0x40074000)
        libdl.so.2 => /usr/local/jdk1.1.6/lib/i586/green_threads/libdl.so.2 (0x4008d000)
        libawt.so => /usr/local/jdk1.1.6/lib/i586/green_threads/libawt.so (0x40091000)
        libXpm.so.4 => /usr/X11R6/lib/libXpm.so.4 (0x400d9000)
        libXt.so.6 => /usr/X11R6/lib/libXt.so.6 (0x400e6000)
        libICE.so.6 => /usr/X11R6/lib/libICE.so.6 (0x40135000)
        libSM.so.6 => /usr/X11R6/lib/libSM.so.6 (0x40149000)
        libXp.so.6 => /usr/X11R6/lib/libXp.so.6 (0x40152000)
        libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x40159000)
        libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x40165000)
        libc.so.6 => /usr/local/jdk1.1.6/lib/i586/green_threads/libc.so.6 (0x4021f000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00000000)
        libdl.so.1 => /lib/libdl.so.1 (0x402c3000)
        libXintl.so.6 => /usr/X11R6/lib/libXintl.so.6 (0x402c8000)

.BUT, executing Java still produces the same error message:
$ java
/usr/local/jdk/bin/i586/green_threads/java: error in loading shared libraries
/usr/X11R6/lib/libXp.so.6: undefined symbol: _Xglobal_lock



Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.