/usr/bin/ld: cannot find -lX11

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

    /usr/bin/ld: cannot find -lX11

    .

    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 .) 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

    1993-2006 by , all rights reserved.

    Questions and comments? Send

    to the Geek Times Webmaster.

    Web space graciously donated by , an Internet Service Provider in . FOO

    Leave a Reply

    Your email address will not be published.