[GRASS-dev] Re: [GRASS GIS] #885: WinGrass: displaying
r.external-linked raster data not working
GRASS GIS
trac at osgeo.org
Fri Jan 22 01:20:05 EST 2010
#885: WinGrass: displaying r.external-linked raster data not working
------------------------------+---------------------------------------------
Reporter: hellik | Owner: grass-dev at lists.osgeo.org
Type: defect | Status: new
Priority: critical | Milestone: 6.4.0
Component: Display | Version: svn-releasebranch64
Resolution: | Keywords: r.external, WinGrass
Platform: MSWindows Vista | Cpu: x86-32
------------------------------+---------------------------------------------
Comment (by glynn):
Replying to [comment:8 hellik]:
> I couldn't find nm for mingw/msys/gnuwin32 on the net... :o(
It should be part of the core MinGW package (it's part of binutils).
> in the output from Dependency Walker there is gdal15 mentioned (see
screenshot)
The following change makes linked maps work with the GDAL library from
OSGeo4W:
{{{
Index: gdal.c
===================================================================
--- gdal.c (revision 40542)
+++ gdal.c (working copy)
@@ -102,11 +102,19 @@
{
load_library();
+# ifdef _WIN32
+ pGDALAllRegister = get_symbol("_GDALAllRegister at 0");
+ pGDALOpen = get_symbol("_GDALOpen at 8");
+ pGDALClose = get_symbol("_GDALClose at 4");
+ pGDALGetRasterBand = get_symbol("_GDALGetRasterBand at 8");
+ pGDALRasterIO = get_symbol("_GDALRasterIO at 48");
+#else
pGDALAllRegister = get_symbol("GDALAllRegister");
pGDALOpen = get_symbol("GDALOpen");
pGDALClose = get_symbol("GDALClose");
pGDALGetRasterBand = get_symbol("GDALGetRasterBand");
pGDALRasterIO = get_symbol("GDALRasterIO");
+#endif
}
#else /* GDAL_DYNAMIC */
}}}
However: this would probably need to change for a 64-bit version of GDAL,
as the sizes of the various types are different (does 64-bit even use
stdcall? IIRC, it was originally chosen due to it reducing code size, but
that was back in the days of "640K is more than enough for any
application").
Also, the example given [http://msdn.microsoft.com/en-
us/library/ms683212%28VS.85%29.aspx here] doesn't use a decorated name,
even though this is the standard for all Windows system functions (except
for variadic functions, which have to use ccall).
--
Ticket URL: <http://trac.osgeo.org/grass/ticket/885#comment:11>
GRASS GIS <http://grass.osgeo.org>
More information about the grass-dev
mailing list