[GRASS-dev] winGRASS: debugging vector db issues

Moritz Lennert mlennert at club.worldonline.be
Tue Feb 27 05:49:48 EST 2007


On 26/02/07 12:51, Paul Kelly wrote:
> On Mon, 26 Feb 2007, Glynn Clements wrote:
> 
>> Paul Kelly wrote:
>>
>>> Moritz, WELL DONE! Using a static libxdr.a with nothing changed from the
>>> link Glynn posted (sorry can't remember where I downloaded it from)
> 
> It was from the link posted here:
> http://grass.itc.it/pipermail/grass-dev/2006-October/026857.html
> to xdr-4.0-mingw2.tar.gz
> 
>> Ah. I solved the _fmode issues locally by patching my MinGW headers,
>> specifically the O_* definitions in <fcntl.h>:
>>
>>     #define    O_RDONLY    (_O_RDONLY | _O_BINARY)
>>     #define O_WRONLY    (_O_WRONLY | _O_BINARY)
>>     #define O_RDWR        (_O_RDWR | _O_BINARY)
>>
>> If libxdr.a is the one which I built, it will probably have binary I/O
>> hard-coded into it. We still need a more general solution, though.
>> AFAICT, every executable should get linked against $(FMODE_OBJ)
>> automatically on Windows; the rules in Module.make use it, and
>> Makefiles which have their own linking rules normally list it
>> explicitly.
> 
> No, the libxdr.a used was one I built myself from the source at the 
> above link. I notice it contains (in xdr_stdio.c):
> 
> #if defined(__CYGWIN32__) || defined(__MINGW32__)
> #include <stdlib.h>
> #include <fcntl.h>
> unsigned int _CRT_fmode = _O_BINARY;
> #endif
> 
> which probably explains why it works when compiled statically. But then 
> all parts of GRASS should be linking against $(FMODE_OBJ) - perhaps 
> parts of the database drivers aren't though? Will hopefully have time to 
> look into it later.

AFAICT, all the db/drivers do, but not the db libs:

mlennert at geog-pc40:~/SRC/GRASS/CVS/grass6/lib/db$ grep -RI FMODE_OBJ *
mlennert at geog-pc40:~/SRC/GRASS/CVS/grass6/lib/db$

Should they ?

Moritz




More information about the grass-dev mailing list