Solved

X lib errors

Posted on 1998-08-20
3
773 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 200 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
I NEED A "BARE" LINUX ... 9 121
Internal CA server 6 134
Krita v3 Linux Mint/Ubuntu 16.04 9 74
Apache web server - how to revoke a certificate produced by a Windows CA? 13 74
rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
Fine Tune your automatic Updates for Ubuntu / Debian
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.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses

734 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