Re: programming X

1999-05-13 Thread Havoc Pennington


Assuming you have the X devel package as others have suggested, you may
also need to tell the compiler where to find the headers:
 -I/usr/X11R6/include

#include X11/Xlib.h should then work.

Xlib is beastly and nasty, so if you aren't very familiar with C
(especially if you're easily frsturated) it's probably a bad place to
start. Gtk would be better, or even better, simple command-line programs.
Gtk is more fun, but a small command line program is probably more
sensible. :-)

HTH,
Havoc






programming X

1999-05-12 Thread spoiler.freeserve.co.uk
Hallo there,
I recently purchased the O'Reilly Xlib Programming Manual with the
aim of learning how to
write X applications. My problem though is I can't get basicwin.c to
compile up at all!
I even downloaded the O'Reilly version and that didn't work. The
O'Reilly version complains
that it can't load Xlib.h although my compile line reads
gcc -g -lX11 -o basicwin basicwin.c
I tried it with a -DSYSV also but to no effect. My version has fits
complaining about undeclared
variables. I suspect I need to include Xfuncproto.h but I'm not certain.

My main question though is, should the example work exactly as
written in the book or do I
need to generate a GNU/Linux version? If so how? If the book's example
should work
then what am I doing obviously wrong?
I can post the compilation error messages once I've retyped the
source, I got annoyed and
blew it away.
Are there any newgroups I should subscribe to for this sort of
information?

thanks


Re: programming X

1999-05-12 Thread Prashanth Mundkur
On Wed, 12 May 1999, spoiler.freeserve.co.uk wrote:

 I even downloaded the O'Reilly version and that didn't work. The
 O'Reilly version complains
 that it can't load Xlib.h although my compile line reads
 gcc -g -lX11 -o basicwin basicwin.c
 I tried it with a -DSYSV also but to no effect. My version has fits
 complaining about undeclared
 variables. I suspect I need to include Xfuncproto.h but I'm not certain.

I would doublecheck whether you have the X development 
package xlib6g-dev 

--prashanth



Re: programming X

1999-05-12 Thread David Z. Maze
spoiler freeserve co uk [EMAIL PROTECTED] writes:
spoiler I recently purchased the O'Reilly Xlib Programming Manual
spoiler with the aim of learning how to write X applications. My
spoiler problem though is I can't get basicwin.c to compile up at
spoiler all!

(You probably don't want to write real applications in Xlib...though I 
found reading through that book fairly educational.  Using a toolkit
like Gtk or Qt might be easier.)

spoiler I even downloaded the O'Reilly version and that didn't
spoiler work. The O'Reilly version complains that it can't load
spoiler Xlib.h although my compile line reads
spoiler gcc -g -lX11 -o basicwin basicwin.c

Right, since the X header files and libraries are in different
directories.  Try something along the lines of
gcc -g -I/usr/X11R6/include -L/usr/X11R6/lib -o basicwin basicwin.c


spoiler My main question though is, should the example work exactly
spoiler as written in the book or do I need to generate a GNU/Linux
spoiler version?

Code written using only POSIX functions and Xlib calls (e.g. all of
the examples in the O'Reilly book) should be *very* portable, and will 
probably build without modification on nearly any Un*xish machine,
save modifications to include and link paths as noted above.

-- 
David Maze [EMAIL PROTECTED]  http://donut.mit.edu/dmaze/
Hey, Doug, do you mind if I push the Emergency Booth Self-Destruct Button?
Oh, sure, Dave, whatever...you _do_ know what that does, right?


Re: programming X

1999-05-12 Thread Andrew Chung
 I even downloaded the O'Reilly version and that didn't work. The
 O'Reilly version complains
 that it can't load Xlib.h although my compile line reads
 gcc -g -lX11 -o basicwin basicwin.c
 I tried it with a -DSYSV also but to no effect. My version has fits
 complaining about undeclared
 variables. I suspect I need to include Xfuncproto.h but I'm not certain.

Do you have the xlib header files installed? They're in the xlib6g-dev 
package...

 Are there any newgroups I should subscribe to for this sort of
 information?

Try comp.os.linux.development.apps

-- 
Andrew Chung[EMAIL PROTECTED]
See http://anderoo.dhs.org/~anderoo/pgp.html for PGP key

It's a sin only if you dwell on the what ifs and the but ifs