?
Solved

X lib errors

Posted on 1998-08-20
3
Medium Priority
?
786 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.
0
Comment
Question by:muesli
  • 2
3 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 1630029
> 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
0
 

Author Comment

by:muesli
ID: 1630030
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



0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 800 total points
ID: 1630031
I suggest to move your libjava to /usr/lib (or /lib) and then run ldconfig again.

For testing you also may set the LD_LIBRARY_PATH environment variable to the needed lib-directories:

    setenv LD_LIBRARY_PATH \
"/lib:/usr/X11R6/lib:/usr/local/jdk1.1.6/lib/i586/green_threads/"

Anyway, the message reported by  java  is strange, looks like a
recursive dependency (which should not be a problem for shared libs). Is  java  as called in your last comment a script which
points to (execs) the executable from another path? then please
execute the binary, /usr/local/jdk/bin/i586/green_threads/java,
itself (probably with the above LD_LIBRARY_PATH).

Also keep in mind that some shells need to be restarted after a ldconfig (csh has a rehash command:-)
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses

599 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question