[winGRASS] compiling native windows driver
Glynn Clements
glynn.clements at virgin.net
Tue Feb 26 16:48:39 EST 2002
Andreas Lange wrote:
> i got stuck with the compiling of the native windows driver.
> I strictly followed the description in
> src/display/devices/windows/INSTALL_WIN.
> (latest cygwin, W2K SP2, Intel PIII). I edited the head-file like the
> description, removed the OBJ.* directories and recompiled (Part 3.a of
> INSTALL_WIN). But this dies in function 'use_window':
> src/display/devices/XDRIVER/XDRIVER24/Graph_set.c:165: undefined
> reference to 'XScreenNumberOfScreen' (sorry, cut&paste does not work
> between Win and Linux).
This appears to be related to a change which I made a few weeks back.
The file src/display/devices/windows/libW11/X11/Xlib.h doesn't declare
this function, and src/display/devices/windows/libW11/w32/xlib.c
doesn't define it. The actual Xlib definition is:
int XScreenNumberOfScreen (scr)
register Screen *scr;
{
register Display *dpy = scr->display;
register Screen *dpyscr = dpy->screens;
register int i;
for (i = 0; i < dpy->nscreens; i++, dpyscr++) {
if (scr == dpyscr) return i;
}
return -1;
}
This ought to work for libW11, although it would probably suffice to
just use:
#define XScreenNumberOfScreen(scr) 0
> Do i need the -D__W98__ on Windows 2000/NT ? This is not clear to me.
> Has someone successfully compiled on W2K/NT?
You need -D__W98__ if either:
a) you are using libW11, or
b) you are building for Win95/98/ME
IOW, you don't need it if you are building for WinNT/2K/XP(?) and you
are using a genuine Xlib.
Basically, a) is because the libW11 emulation doesn't work following a
fork(), and b) is because Cygwin doesn't handle the fork() in
src/display/devices/lib/main.c correctly on Win95/98/ME.
--
Glynn Clements <glynn.clements at virgin.net>
More information about the grass-windows
mailing list