xlib compile issues

Igor Pechtchanski pechtcha@cs.nyu.edu
Thu Oct 7 14:06:00 GMT 2004

On Thu, 7 Oct 2004, Zach Gelnett wrote:

> That seems to fix the issue, but it happens over and over again, is there
> some setting I can change as it seems that all make files that I'm
> downloading for these dockapps have the order of the above example instead
> of the below example.
> gcc -pedantic -Wall -W -O -L/usr/X11R6/lib -lX11 \
> `pkg-config --libs glib-2.0` docker.o kde.o icons.o xproperty.o net.o -o docker
> gcc -pedantic -Wall -W -O -L/usr/X11R6/lib \
>   docker.o kde.o icons.o xproperty.o net.o -o \
>   docker `pkg-config --libs glib-2.0` -lX11

configure issue, most likely.  It looks like "-L/usr/X11R6/lib -lX11" (and
`pkg-config --libs glib-2.0`) are added to LDFLAGS instead of LDLIBS.
FYI, adding them to LDLIBS in the same order they were added to LDFLAGS
will result in

gcc -pedantic -Wall -W -O docker.o kde.o icons.o xproperty.o net.o \
  -L/usr/X11R6/lib -lX11 `pkg-config --libs glib-2.0` -o docker

The placement of the "-o docker" doesn't matter, though, and neither does
that of "-L/usr/X11R6/lib" (as long as it's before "-lX11").

Incidentally, `pkg-config --libs glib-2.0` is a) buggy (won't work if
there are spaces in directories -- the whole `...` expression needs to be
quoted for that), and b) inefficient (better to save the output in a
variable once).
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Happiness lies in being privileged to work hard for long hours in doing
whatever you think is worth doing."  -- Dr. Jubal Harshaw

More information about the Cygwin-xfree mailing list