| View previous topic :: View next topic |
| Author |
Message |
arereal2 Xplorer
Joined: 05 Jan 2006 Posts: 22
|
Posted: Sun Jan 08, 2006 10:33 am Post subject: ld cannot find -lXext |
|
|
Hi, I'm trying to build kchmviewer and am getting this error.
usr/bin/ld: cannot find -lXext
I've done a lot of googling for this error and it would seem I have all of the correct libs installed. I also found the library in /usr/X11R6/lib/libXext.so (and so.6, so.6.4)
Can anybody help?
Cheers!
-J |
|
| Back to top |
|
 |
Chaotic Thought Xandrosianding

Joined: 08 Jul 2005 Posts: 881 Location: Arlington TX
|
Posted: Sun Jan 08, 2006 2:52 pm Post subject: |
|
|
| Please post the output of 'make' at least a page of output where the error occurs. I need to see commands were given like gcc ... |
|
| Back to top |
|
 |
Andrew Xendrosian

Joined: 22 Feb 2003 Posts: 1739 Location: Wisconsin, USA
|
Posted: Sun Jan 08, 2006 3:03 pm Post subject: |
|
|
you need to install
xlibs-dev
from xandros networks _________________ Registered Linux user number 316996 |
|
| Back to top |
|
 |
arereal2 Xplorer
Joined: 05 Jan 2006 Posts: 22
|
Posted: Sun Jan 08, 2006 4:17 pm Post subject: |
|
|
Hi Andrew, I already have xlibs-dev installed.
Chaotic_Thought, here's the output...
| Code: |
Making all in chmlib
make[1]: Entering directory `/home/jason/source/kchmviewer-1.3/chmlib'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/jason/source/kchmviewer-1.3/chmlib'
Making all in src
make[1]: Entering directory `/home/jason/source/kchmviewer-1.3/src'
make all-am
make[2]: Entering directory `/home/jason/source/kchmviewer-1.3/src'
/bin/sh ../libtool --silent --tag=CXX --mode=link g++ -Wnon-virtual-dtor -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -O2 -Wformat-security -Wmissing-format-attribute -fno-exceptions -fno-check-new -fno-common -okchmviewer -L/usr/share/qt3/lib iconstorage.o kchmbookmarkwindow.o kchmconfig.o kchmindexwindow.o kchmmainwindow.o kchmsearchtoolbar.o kchmsearchwindow.o kchmsettings.o kchmsourcefactory.o kchmtextencoding.o kchmtreeviewitem.o kchmviewwindow.o main.o xchmfile.o kchmdialogchooseurlfromlist.o kde-qt.o kchmviewwindow_qtextbrowser.o kchmviewwindow_khtmlpart.o kqtempfile.o kchmsetupdialog.o kchmbookmarkwindow.moc.o kchmsearchwindow.moc.o kchmviewwindow_qtextbrowser.moc.o kchmindexwindow.moc.o kchmdialogchooseurlfromlist.moc.o kchmmainwindow.moc.o kchmsearchtoolbar.moc.o ../chmlib/libchm.la -lqt-mt -lz -lpng -lz -lm -lXext -lX11 -lSM-lICE -lpthread
/usr/bin/ld: cannot find -lXext
collect2: ld returned 1 exit status
make[2]: *** [kchmviewer] Error 1
make[2]: Leaving directory `/home/jason/source/kchmviewer-1.3/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/jason/source/kchmviewer-1.3/src'
make: *** [all-recursive] Error 1
|
gcc version is 3.3.5
ld version is 2.15
xlibs-dev version is 6.8.2.xandros.2-11
If you need any other version numbers to help identify the problem then just yell.
Thanks guys
-J |
|
| Back to top |
|
 |
arereal2 Xplorer
Joined: 05 Jan 2006 Posts: 22
|
Posted: Sun Jan 08, 2006 4:21 pm Post subject: |
|
|
I figured the output from ./configure may also prove useful...
| Code: |
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking for -p flag to install... yes
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking whether g++ supports -Wmissing-format-attribute... yes
checking whether gcc supports -Wmissing-format-attribute... yes
checking whether g++ supports -Wundef... yes
checking whether g++ supports -Wno-long-long... yes
checking whether g++ supports -Wnon-virtual-dtor... yes
checking whether g++ supports -fno-exceptions... yes
checking whether g++ supports -fno-check-new... yes
checking whether g++ supports -fno-common... yes
checking whether g++ supports -fexceptions... yes
checking how to run the C++ preprocessor... g++ -E
checking whether g++ supports -O0... yes
checking whether g++ supports -Wl,--no-undefined... yes
checking whether g++ supports -Wl,--allow-shlib-undefined... yes
checking for X... libraries /usr/X11R6/lib, headers /usr/X11R6/include
checking for gethostbyname... yes
checking for connect... yes
checking for remove... yes
checking for shmat... yes
checking for IceConnectionNumber in -lICE... yes
not using lib directory suffix
checking for a sed that does not truncate output... /bin/sed
checking for egrep... grep -E
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognise dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for g77... no
checking for f77... no
checking for xlf... no
checking for frt... no
checking for pgf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for f90... no
checking for xlf90... no
checking for pgf90... no
checking for epcf90... no
checking for f95... no
checking for fort... no
checking for xlf95... no
checking for ifc... no
checking for efc... no
checking for pgf95... no
checking for lf95... no
checking for gfortran... no
checking whether we are using the GNU Fortran 77 compiler... no
checking whether accepts -g... no
checking the maximum length of command line arguments... 32768
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if gcc static flag works... yes
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc supports -c -o file.o... yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking for shl_load... no
checking for shl_load in -ldld... no
checking for dlopen... no
checking for dlopen in -ldl... yes
checking whether a program can dlopen itself... yes
checking whether a statically linked program can dlopen itself... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
configure: creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by g++... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC
checking if g++ PIC flag -fPIC works... yes
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking for shl_load... (cached) no
checking for shl_load in -ldld... (cached) no
checking for dlopen... (cached) no
checking for dlopen in -ldl... (cached) yes
checking whether a program can dlopen itself... (cached) yes
checking whether a statically linked program can dlopen itself... (cached) yes
appending configuration tag "F77" to libtool
checking for strlcat... no
checking if strlcat needs custom prototype... yes - in libkdefakes
checking for strlcpy... no
checking if strlcpy needs custom prototype... yes - in libkdefakes
checking for main in -lutil... yes
checking for main in -lcompat... no
checking for crypt in -lcrypt... yes
checking for socklen_t... yes
checking for dnet_ntoa in -ldnet... no
checking for dnet_ntoa in -ldnet_stub... no
checking for inet_ntoa... yes
checking for connect... (cached) yes
checking for remove... (cached) yes
checking for shmat... (cached) yes
checking for sys/types.h... (cached) yes
checking for stdint.h... (cached) yes
checking sys/bitypes.h usability... yes
checking sys/bitypes.h presence... yes
checking for sys/bitypes.h... yes
checking for poll in -lpoll... no
checking Carbon/Carbon.h usability... no
checking Carbon/Carbon.h presence... no
checking for Carbon/Carbon.h... no
checking CoreAudio/CoreAudio.h usability... no
checking CoreAudio/CoreAudio.h presence... no
checking for CoreAudio/CoreAudio.h... no
checking if res_init needs -lresolv... yes
checking for res_init... yes
checking if res_init needs custom prototype... no
checking for killpg in -lucb... no
checking for int... yes
checking size of int... 4
checking for short... yes
checking size of short... 2
checking for long... yes
checking size of long... 4
checking for char *... yes
checking size of char *... 4
checking for dlopen in -ldl... (cached) yes
checking for shl_unload in -ldld... no
checking for size_t... yes
checking size of size_t... 4
checking for unsigned long... yes
checking size of unsigned long... 4
checking sizeof size_t == sizeof unsigned long... yes
checking crt_externs.h usability... no
checking crt_externs.h presence... no
checking for crt_externs.h... no
checking for _NSGetEnviron... no
checking for vsnprintf... yes
checking for snprintf... yes
checking for X... libraries /usr/X11R6/lib, headers /usr/X11R6/include
checking for IceConnectionNumber in -lICE... (cached) yes
checking for libXext... yes
checking for pthread_create in -lpthread... yes
checking for extra includes... no
checking for extra libs... no
checking for libz... -lz
checking for libpng... -lpng -lz -lm
checking for libjpeg6b... no
checking for libjpeg... -ljpeg
checking for perl... /usr/bin/perl
checking for Qt... libraries /usr/share/qt3/lib, headers /usr/share/qt3/includeusing -mt
checking for moc... /usr/share/qt3/bin/moc
checking for uic... /usr/share/qt3/bin/uic
checking whether uic supports -L ... yes
checking whether uic supports -nounload ... yes
checking if Qt needs -ljpeg... no
configure: creating ./config.status
config.status: creating src/Makefile
config.status: creating Makefile
config.status: creating kio-msits/Makefile
config.status: creating chmlib/Makefile
config.status: creating src/config.h
config.status: src/config.h is unchanged
config.status: executing depfiles commands
Please remember to use GNU make, often installed as gmake.
Install prefix : /usr/local
KDE support : disabled.
Qt includes : -I/usr/share/qt3/include
Qt libraries : -lqt-mt $(LIBZ) $(LIBPNG) -lXext $(LIB_X11) $(LIBSM) -lpthread
|
|
|
| Back to top |
|
 |
Arne Anka Xanspiration

Joined: 21 Mar 2004 Posts: 4186 Location: Stockholm, Sweden
|
Posted: Sun Jan 08, 2006 4:46 pm Post subject: |
|
|
| The check above indicates you have the library in question. Just to be sure, check if /etc/ld.so.conf has /usr/X11R6/lib included (it should have). |
|
| Back to top |
|
 |
arereal2 Xplorer
Joined: 05 Jan 2006 Posts: 22
|
Posted: Sun Jan 08, 2006 5:43 pm Post subject: |
|
|
Hi Arne,
yes it does, the exact contents are...
| Code: |
/usr/lib/ati
/usr/X11R6/lib
/usr/local/lib
/usr/lib/atlas
|
|
|
| Back to top |
|
 |
Chaotic Thought Xandrosianding

Joined: 08 Jul 2005 Posts: 881 Location: Arlington TX
|
Posted: Sun Jan 08, 2006 6:05 pm Post subject: |
|
|
I think the problem is that your program is trying to build a static library, but to do that you need a static libXext (usually named with an .a extension), but all you have is libXext.so.
You probably can disable this behaviour by going to your toplevel build directory (of kchmviewer), removing config.log and config.status, then re-running ./configure like this: | Code: | | ./configure --disable-static --enable-shared |
|
|
| Back to top |
|
 |
arereal2 Xplorer
Joined: 05 Jan 2006 Posts: 22
|
Posted: Sun Jan 08, 2006 6:20 pm Post subject: |
|
|
Good idea CT, but it's not that.
Could it be something missing from my environment variables?
-J |
|
| Back to top |
|
 |
Chaotic Thought Xandrosianding

Joined: 08 Jul 2005 Posts: 881 Location: Arlington TX
|
Posted: Sun Jan 08, 2006 6:35 pm Post subject: |
|
|
Well, I'd say the build process is definitely looking for 'libXext.a' which is a static library. I'm not sure if Xandros's development packages include the static libraries. If they don't, then you won't have any luck with them.
If you want to do it the 'brute force' way you can install this library from some RPM on the Internet. Use version x.org 6.8.2 since that's what Xandros uses. I did a search on rpm.pbone.net and found some that have this. Don't use RPM to extract the files, but do this:
| Code: | mkdir -p /build/xorg-static
cd /build/xorg-static
rpm2cpio xorg-x11-devel-static-6.8.2-alt19.i586.rpm | cpio -id
|
Then locate the libXext.a file in the tree with this: | Code: | find /build/xorg-static -name libXext.a
|
You can assign the path to a variable such as XORG_STATIC because you'll need it:
Now include this path in your LDFLAGS and re-run configure (you may have to remove config.log and config.status before running configure again):
| Code: | cd /build/kchmviewer
LDFLAGS="-L${XORG_STATIC}" ./configure
|
|
|
| Back to top |
|
 |
arereal2 Xplorer
Joined: 05 Jan 2006 Posts: 22
|
Posted: Sun Jan 08, 2006 7:10 pm Post subject: |
|
|
Thanks for taking the time to help me with this. I tried exactly what you said and I'm getting the exact same linker error. I'm going to continue tinkering and see if I can persuade the linker.
Edit:
Cracked it, I had typed ./configure on a seperate line.
How come having the LDFLAGS="-L${XORG_STATIC}" and ./configure on the same line makes a difference? I'm reasonably new to linux but not to development so little things like this throw me.
Thanks again
-J |
|
| Back to top |
|
 |
Chaotic Thought Xandrosianding

Joined: 08 Jul 2005 Posts: 881 Location: Arlington TX
|
Posted: Sun Jan 08, 2006 7:44 pm Post subject: |
|
|
| arereal2 wrote: | | How come having the LDFLAGS="-L${XORG_STATIC}" and ./configure on the same line makes a difference? I'm reasonably new to linux but not to development so little things like this throw me. |
When you type "KEY=value" to your shell (bash) it stores the value local to that process only. For example: | Code: | $ MY_NAME=chaotic
$ echo $MY_NAME
chaotic
$ bash
$ echo $MY_NAME
$ exit
exit
$ echo $MY_NAME
chaotic
|
The new bash process has no knowledge of the value I set in the parent (exit takes you back to the parent). To make the value available to all child processes, the shell has a command export to do that. Type help export for more information. Instead of export, though, a safer alternative is the syntax that I used above: | Code: | $ MY_NAME=chaotic bash
$ echo $MY_NAME
chaotic
$
|
Using that syntax, we export only the value specified before the command. The full syntax is
VAR1="value1" VAR2="value2" [...] VARn="value_n" command arguments
That is, you can specify as many variables as you want. Remember to put your values in quotes if they have spaces in them. For instance, CFLAGS. |
|
| Back to top |
|
 |
Chaotic Thought Xandrosianding

Joined: 08 Jul 2005 Posts: 881 Location: Arlington TX
|
Posted: Sun Jan 08, 2006 7:46 pm Post subject: |
|
|
| So the XORG_STATIC thing worked? That's good. By the way, you can remove your XORG_STATIC directory after you've built the software. Static libraries do not need to be kept around after being linked (but shared ones do). |
|
| Back to top |
|
 |
arereal2 Xplorer
Joined: 05 Jan 2006 Posts: 22
|
Posted: Sun Jan 08, 2006 7:52 pm Post subject: |
|
|
I figured it may have something to do with scope. What threw me was using export for XORG_STATIC but forgetting to use export for LDFLAGS. I was thinking they're both global, why!? - If I had used export on LDFLAGS it would have worked. But it is handy to know about the variable scope on the same command line, thanks very much for that info.
-J |
|
| Back to top |
|
 |
Chaotic Thought Xandrosianding

Joined: 08 Jul 2005 Posts: 881 Location: Arlington TX
|
Posted: Sun Jan 08, 2006 7:54 pm Post subject: |
|
|
| arereal2 wrote: | | What threw me was using export for XORG_STATIC but forgetting to use export for LDFLAGS. |
XORG_STATIC is a good example--it did not need to be exported because the only process that was using it was the shell (in a substitution). Perhaps a better name would have been xorg_static. It's sometimes useful to distinguish with case the intended scope. |
|
| Back to top |
|
 |
|