How can i link to X11 with gcc?

Andrew Markebo flognat@flognat.myip.org
Mon Feb 18 13:37:00 GMT 2002


/ "Oleg Giwodiorow" <Oleg.Giwodiorow@gmx.net> wrote:
| Hi,
| I suppose this question is stupid, but i can not figure it out myself...

No questions is stupid.. just the answers.. or ehm.. ;-) well dumb I
suppose.. 

First error, telling gcc which libs to use have to be in the end of
the link command, so instead of "gcc -lX11 foo.c" it should be "gcc
foo.c -lX11", I have seen this 'problem' many times now, why do you
have the libs first?? Inheritance from VisualC/C++?

Secondly well the X11 libs is in /usr/X11R6/lib, so that should be in
the linkpath yep.. 

If the two above comments don't help you, add  -lXext -lICE -lXaw and
maybe -lXmu to the link line.

        /Andy

-- 
 The eye of the beholder rests on the beauty!



More information about the Cygwin-xfree mailing list