*BSD News Article 95046


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.ecn.uoknor.edu!feed1.news.erols.com!cpk-news-hub1.bbnplanet.com!news.bbnplanet.com!rill.news.pipex.net!pipex!tank.news.pipex.net!pipex!news.utell.co.uk!usenet
From: brian@shift.utell.net (Brian Somers)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Compiling and linking with X.
Date: 9 May 1997 11:21:51 GMT
Organization: Awfulhak Ltd.
Lines: 34
Message-ID: <5kv1cf$8cq@ui-gate.utell.co.uk>
References: <3372A499.41C67EA6@silas.cc.monash.edu.au>
Reply-To: brian@awfulhak.org, brian@utell.co.uk
NNTP-Posting-Host: shift.utell.net
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Newsreader: knews 0.9.8
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:40634

In article <3372A499.41C67EA6@silas.cc.monash.edu.au>,
	David Henshaw <dhenshaw@silas.cc.monash.edu.au> writes:
> Hi all,
> 
> I'm trying to compile a program that uses some X libs.
> The includes are specified as required.
> i.e. #include <X11/Xlib.h>
> 
> I keep getting the following errors when I try compiling with
> cc -o xidle xidle.c -lX11
> 
> xidle.c:26: X11/Xlib.h: No such file or directory
> xidle.c:27: X11/Xatom.h: No such file or directory
> xidle.c:28: X11/Xresource.h: No such file or directory
> xidle.c:29: X11/Xutil.h: No such file or directory
> xidle.c:30: X11/cursorfont.h: No such file or directory
> 
> Any ideas as to what may be wrong ?
> The libraries have been installed in /usr/X11R6/include/X11 as per the
> sysinstall procedure.

You'll need to

    cc -o -I/usr/X11R6/include xidle xidle.c -L/usr/X11R6/lib -lX11

cc only looks in /usr/include for includes and /usr/lib for libs
by default.

RTFM cc for more info.

-- 
Brian <brian@awfulhak.org> <brian@freebsd.org>
      <http://www.awfulhak.org>
Don't _EVER_ lose your sense of humour !