Geek Times - /usr/bin/ld: cannot find -lX11

Welcome to Geek Times!
spacer
/usr/bin/ld: cannot find -lX11
home
search
archive
about

Tux

Linux

Contents

System Administration

Hardware

Networking

Security

Software

Hardware

U. I.

3rd Parties

Mac-on-Linux

Troubleshooting


 
.
When building a program designed to run in the X Window System I encountered the following error message:
make[1]: Entering directory `/usr/src/redhat/SOURCES/aterm-0.3.6/src'
gcc -O -o aterm [numerous object files elided] -lX11 
/usr/bin/ld: cannot find -lX11

I was sure that I'd installed the X development package, so that wasn't the problem. (If you haven't already installed it, you may want to read Finding an RPM on the distribution media.) Why then couldn't the development environment find libX11.so?

It turns out that the /usr/X11R6/lib directory isn't part of the default ld(1) search path, so I needed to have the flag "-L/usr/X11R6/lib" somewhere before "-lX11" in the offending command.

 

Geek Times copyright information
This page is copyrighted 1993-2006 by Geek Times, all rights reserved. Questions and comments? Send email to the Geek Times Webmaster. Web space graciously donated by rawbandwidth.com, an Internet Service Provider in San Francisco. FOO

email