From owner-freebsd-hackers@FreeBSD.ORG Sun Dec 17 22:31:41 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D79B916A494 for ; Sun, 17 Dec 2006 22:31:41 +0000 (UTC) (envelope-from erikt@midgard.homeip.net) Received: from ch-smtp02.sth.basefarm.net (ch-smtp02.sth.basefarm.net [80.76.149.213]) by mx1.FreeBSD.org (Postfix) with ESMTP id DDDC143E02 for ; Sun, 17 Dec 2006 22:26:18 +0000 (GMT) (envelope-from erikt@midgard.homeip.net) Received: from c83-253-29-241.bredband.comhem.se ([83.253.29.241]:56118 helo=falcon.midgard.homeip.net) by ch-smtp02.sth.basefarm.net with smtp (Exim 4.63) (envelope-from ) id 1Gw4SF-0003k9-8d for freebsd-hackers@freebsd.org; Sun, 17 Dec 2006 23:26:00 +0100 Received: (qmail 17915 invoked from network); 17 Dec 2006 23:25:47 +0100 Received: from owl.midgard.homeip.net (10.1.5.7) by falcon.midgard.homeip.net with SMTP; 17 Dec 2006 23:25:47 +0100 Received: (qmail 81618 invoked by uid 1001); 17 Dec 2006 23:25:47 +0100 Date: Sun, 17 Dec 2006 23:25:47 +0100 From: Erik Trulsson To: Henry Lenzi Message-ID: <20061217222547.GA81577@owl.midgard.homeip.net> Mail-Followup-To: Henry Lenzi , freebsd-hackers@freebsd.org References: <8b4c81f0612161943g2cef8374p91445780389e7f88@mail.gmail.com> <20061217034846.GC43992@dan.emsphone.com> <8b4c81f0612171410g14a03a46t2de530fd4afeed0a@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8b4c81f0612171410g14a03a46t2de530fd4afeed0a@mail.gmail.com> User-Agent: Mutt/1.5.13 (2006-08-11) X-Scan-Result: No virus found in message 1Gw4SF-0003k9-8d. X-Scan-Signature: ch-smtp02.sth.basefarm.net 1Gw4SF-0003k9-8d 54de6276ce5b89abb7e42e996f5bd463 Cc: freebsd-hackers@freebsd.org Subject: Re: Newbie request - compiling with Xlib.h X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Dec 2006 22:31:41 -0000 On Sun, Dec 17, 2006 at 08:10:58PM -0200, Henry Lenzi wrote: > On 12/17/06, Dan Nelson 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 > (...) > -- Erik Trulsson ertr1013@student.uu.se