[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: The X11 library '-lX11' could not be found
From: |
J.H.M. Dassen (Ray) |
Subject: |
Re: The X11 library '-lX11' could not be found |
Date: |
Wed, 24 Sep 2003 19:51:46 +0200 |
User-agent: |
Mutt/1.5.4i |
On Tue, Sep 23, 2003 at 13:15:25 -0700, John Urness wrote:
> Here is a partial output from the config.log from where XOpenDisplay first
> shows up:
>
> configure:13890: g++ -o conftest -g -O2 -fpermissive conftest.cc
> -L/usr/X11/lib -R/usr/X11/lib -lX11 >&5
> 1102 Undefined first referenced
> 1103 symbol in file
> 1104 socket /usr/X11/lib/libX11.so
> 1105 getpeername /usr/X11/lib/libX11.so
OK, so libX11 is being found, but it depends (unexpectedly) on other
libraries (probably: -lsocket) for socket(), getpeername() etc.
Under Linux with a GNU build environment one can link a library like libX11
in a way that it pulls in such dependencies automatically (through "NEEDED"
entries in the dynamic section of the libX11.so ELF file); this works by
adding "-l"s for those libraries to the link command that produces
libX11.so, something like
gcc -Wl,shared -o libX11.so.1.2.3 foo.o bar.o baz.o -lsocket -ldl
Presumably something similar can be done on Solaris to ensure that libX11
pulls in its dynamic library dependencies.
HTH,
Ray
--
LWN normally tries to avoid talking much about Microsoft - it is simply
irrelevant to the free software world most of the time.
http://www.lwn.net/2000/0406/