[GRASS-dev] compiling error for r.le.setup in Windows: sleep not implemented

r.le.setup won't compile on Windows because of the use of sleep. We could
replace it by G_sleep to make it compile, but at the moment, this is just
an empty token for Windows. Is sleep essential for r.le.setup ? How
difficult is implementing a windows version of sleep ?

OBJ.i686-pc-mingw32/ask_group.o: In function
`get_group_drv':c:/grasssrc/grass6/raster/r.le/r.le.setup/ask_group.c:100:
undefined reference to `sleep'
:c:/grasssrc/grass6/raster/r.le/r.le.setup/ask_group.c:106: undefined
reference to `sleep'
:c:/grasssrc/grass6/raster/r.le/r.le.setup/ask_group.c:112: undefined
reference to `sleep'
:c:/grasssrc/grass6/raster/r.le/r.le.setup/ask_group.c:118: undefined
reference to `sleep'
:c:/grasssrc/grass6/raster/r.le/r.le.setup/ask_group.c:124: undefined
reference to `sleep'
OBJ.i686-pc-mingw32/ask_group.o:c:/grasssrc/grass6/raster/r.le/r.le.setup/ask_group.c:130:
more undefined references to `sleep' follow
collect2: ld returned 1 exit status
make: *** [/c/grasssrc/grass6/dist.i686-pc-mingw32/bin/r.le.setup.exe]
Error 1

Moritz

Moritz Lennert wrote:

r.le.setup won't compile on Windows because of the use of sleep. We
could replace it by G_sleep to make it compile,

done in CVS HEAD.

but at the moment, this is just an empty token for Windows. Is sleep
essential for r.le.setup ?

sleep is used in r.le.setup to give you a chance to read the result of a
command before the screen (text menu) is cleared to make way for the
next menu.

How difficult is implementing a windows version of sleep ?

no idea, but having a fn which the programmer intends to do something
but it fails to do, isn't so nice.

Hamish

Hamish wrote:

> How difficult is implementing a windows version of sleep ?

no idea, but having a fn which the programmer intends to do something
but it fails to do, isn't so nice.

Does _sleep() work? It's declared in MinGW's stdlib.h, with a note
that it's deprecated in favour of Sleep() (from Kernel32.dll).

Otherwise, you could busy-wait on time(); it's less than ideal, but
should work.

--
Glynn Clements <glynn@gclements.plus.com>