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

Martin Landa landa.martin at gmail.com
Thu Dec 10 01:41:20 PST 2015


Hi,

2015-12-10 10:27 GMT+01:00 Even Rouault <even.rouault at spatialys.com>:
> And normally ./configure should define HAVE_DIRECT_H in port/cpl_config.h only if
> it is available.

to be more precise, I am building GRASS against GDAL shipped via
OSGeo4W (which has HAVE_DIRECT_H already defined). I didn't find this
header in OSGeo4W framework.

>> 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
>
> Isn't that a GRASS issue since getcwd() is really called from GRASS code. I'd
> note that GDAL has a CPLGetCurrentDir() function that is essentially a wrapper
> around getcwd(). See port/cpl_path.cpp

getcwd() is used on other places in GRASS, the only failing is
r.external which is linked to GDAL. I found out that GDAL defines:

#ifndef getcwd
#define getcwd _getcwd
#endif

Could be this the issue?

Martin

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


More information about the gdal-dev mailing list