This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: help compiling a program using Xlib


When compiling for X, you must explicitly link it with libX11.

g++ -lX11 -L<absolute path to X11 libs> <filename-to-compile> -o
<output-filename>

ex.) on my system your code compiles fine using

g++ -lX11 -L/usr/X11R6/lib gcctest.cc

Reality is but a brief respite between my fantasies.
                                                        -unknown


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]