Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Dec 2006 23:25:47 +0100
From:      Erik Trulsson <ertr1013@student.uu.se>
To:        Henry Lenzi <henry.lenzi@gmail.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Newbie request - compiling with Xlib.h
Message-ID:  <20061217222547.GA81577@owl.midgard.homeip.net>
In-Reply-To: <8b4c81f0612171410g14a03a46t2de530fd4afeed0a@mail.gmail.com>
References:  <8b4c81f0612161943g2cef8374p91445780389e7f88@mail.gmail.com> <20061217034846.GC43992@dan.emsphone.com> <8b4c81f0612171410g14a03a46t2de530fd4afeed0a@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Dec 17, 2006 at 08:10:58PM -0200, Henry Lenzi wrote:
> On 12/17/06, Dan Nelson <dnelson@allantgroup.com> wrote:
> >In the last episode (Dec 17), Henry Lenzi said:
> >> I'm trying to follow the following tutorial for Xlib prpogramming:
> >>
> >> 
> >http://users.actcom.co.il/~choo/lupg/tutorials/xlib-programming/xlib-programming.html#preface
> >>
> >> However, I can't seem to compile the simple-drawing.c example. I keep
> >> getting
> >>
> >>
> >> >cc simple-drawing.c  -o simple-drawing -L/usr/X11/lib -lX11
> >> simple-drawing.c:7:22: X11/Xlib.h: No such file or directory
> >
> >Note that X is in /usr/X11R6, not /usr/X11, so your link option shoudl
> >read -L/usr/X11R6/lib.
> >
> >You need -I/usr/X11R6/include as well.  -I is for headers and is used
> >during the compile step, -L is for libraries and is used during the
> >link step.  Your commandline is a direct source-to-executable command,
> >so it requires both.
> >
> Hi
> 
> It didn't work. X is installed, and libX is in place.
> 
> >gcc simple-drawing.c -o simple-drawing -L/usr/X11R6/lib -l/usr/X11R6/include
                                                           ^^

Wrong options letter.  You should use '-I' (upper case 'i'), not '-l' (lower
case 'L')

> simple-drawing.c:7:22: X11/Xlib.h: No such file or directory
> simple-drawing.c:23: error: syntax error before "create_simple_window"
> simple-drawing.c:23: error: syntax error before '*' token
> (...)
> 


-- 
<Insert your favourite quote here.>
Erik Trulsson
ertr1013@student.uu.se



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20061217222547.GA81577>