From owner-freebsd-hackers@FreeBSD.ORG Sun Dec 17 22:11:01 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 C7BC816A403 for ; Sun, 17 Dec 2006 22:11:01 +0000 (UTC) (envelope-from henry.lenzi@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.184]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8CB8B43CA3 for ; Sun, 17 Dec 2006 22:11:00 +0000 (GMT) (envelope-from henry.lenzi@gmail.com) Received: by nf-out-0910.google.com with SMTP id x37so1664634nfc for ; Sun, 17 Dec 2006 14:10:59 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=oWsW3NWM+yeG8Lsk0O6HY/YVTJK/LuucdSBvlRKWHlNtBE9XzjNIWYMHMFiRqh/KWjjJEdXFIUEtfy+uqKV6nIQ0O68e9kxTy8+aAmRSyeJWEnumKObzjx/zKObqItSMO/xsHNJJhEzGFplqf22lSu94mhdKGXhvwdrekHLOrKM= Received: by 10.78.201.2 with SMTP id y2mr2433487huf.1166393458896; Sun, 17 Dec 2006 14:10:58 -0800 (PST) Received: by 10.78.172.7 with HTTP; Sun, 17 Dec 2006 14:10:58 -0800 (PST) Message-ID: <8b4c81f0612171410g14a03a46t2de530fd4afeed0a@mail.gmail.com> Date: Sun, 17 Dec 2006 20:10:58 -0200 From: "Henry Lenzi" To: freebsd-hackers@freebsd.org In-Reply-To: <20061217034846.GC43992@dan.emsphone.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <8b4c81f0612161943g2cef8374p91445780389e7f88@mail.gmail.com> <20061217034846.GC43992@dan.emsphone.com> 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:11:01 -0000 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 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 (...) I have this on the c file: #include #include #include /* getenv(), etc. */ #include /* sleep(), etc. */ I don't understand. It should work... Any help greatly appreciated. TIA to all Henry