[gdal-dev] direct.h and other Windows issue

Martin Landa landa.martin at gmail.com
Thu Dec 10 01:11:19 PST 2015


Hi all,

currently I am working on Windows GRASS builds (using MSYS2 +
MinGW64). I have still some issue with GDAL which I am not sure how to
correctly solve:

1) GDAL has enabled in cpl_port.h

#ifdef HAVE_DIRECT_H
#  include <direct.h>
#endif

which is old header used by MSVC, modern is dirent.h, right?

I moved forward by simply commenting these lines. Unfortunately two
GRASS modules linked to GDAL still fails to compile:

2) r.external

OBJ.x86_64-w64-mingw32/main.o: In function `main':
/home/landa/grass_trunk/raster/r.external/main.c:154: undefined
reference to `_getcwd'
/home/landa/grass_trunk/raster/r.external/main.c:154:(.text.startup+0x538):
relocation truncated to fit: R_X86_64_PC32 against undefined symbol
`_getcwd'
collect2: error: ld returned 1 exit status

3) r.in.gdal

OBJ.x86_64-w64-mingw32/main.o: In function `dump_rat':
/home/landa/grass_trunk/raster/r.in.gdal/main.c:1601: undefined
reference to `_snprintf'
/home/landa/grass_trunk/raster/r.in.gdal/main.c:1601:(.text.startup+0x1655):
relocation truncated to fit: R_X86_64_PC32 against undefined symbol
`_snprintf'
collect2: error: ld returned 1 exit status

I am not sure how to solve these issues correctly. Any idea?

Thanks in advance for any tips, Martin

-- 
Martin Landa
http://geo.fsv.cvut.cz/gwiki/Landa
http://gismentors.cz/mentors/landa


More information about the gdal-dev mailing list