From owner-freebsd-hackers@FreeBSD.ORG Sun Dec 17 03:48:47 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 8ABF716A412 for ; Sun, 17 Dec 2006 03:48:47 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 17E0A43CA2 for ; Sun, 17 Dec 2006 03:48:47 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.13.6/8.13.8) id kBH3mkov048723; Sat, 16 Dec 2006 21:48:46 -0600 (CST) (envelope-from dan) Date: Sat, 16 Dec 2006 21:48:46 -0600 From: Dan Nelson To: Henry Lenzi Message-ID: <20061217034846.GC43992@dan.emsphone.com> References: <8b4c81f0612161943g2cef8374p91445780389e7f88@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8b4c81f0612161943g2cef8374p91445780389e7f88@mail.gmail.com> X-OS: FreeBSD 6.2-PRERELEASE X-message-flag: Outlook Error User-Agent: Mutt/1.5.13 (2006-08-11) 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 03:48:47 -0000 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. -- Dan Nelson dnelson@allantgroup.com