[gdal-dev] 1.4.4 Preliminary Win32 Binaries

Ari Jolma ari.jolma at tkk.fi
Sat Nov 24 08:13:28 EST 2007


Even Rouault kirjoitti:
> Hi,
>
> First, I found the following discussion on CPL_STDCALL problems  :
> http://www.nabble.com/Windows-linking-to-FWTools-gdal_i.lib-t1128647.html
>   

Yes, AFAIK Roger is also using MSYS and MinGW to compile R-spatial for 
windows

> I think you pointed out exactly where your problem is.
>   

Well, I'm not so sure if it's my problem! :) see below...

> Whereas, libgdal14.dll compiled by Frank with MVSC 7.1  takes into account 
> CPL_STDCALL  and exports these symbols with the _foo at X decorations.
>   

ok, but why it's done for some and not all? And if it's needed for some, 
why not define it twice, i.e.:

const char CPL_DLL * CPL_STDCALL CPLGetLastErrorMsg( void );
const char CPL_DLL * CPLGetLastErrorMsg( void );

that would create quite a lot of extra stuff into headers but my guess 
is that it would make the resulting dll (made by VC) usable also in 
MinGW world (except that the name issue would still be there). But I'm 
still puzzled why _Foo at 0 syntax is needed *only* for some functions? 
Because it seems that the programs (e.g. the exes in the package) need 
to know how to call functions in both syntaxes. Indeed, looking at 
gdal_rasterize.exe:

Import Table:
  gdal14.dll
    Import Adress Table:                0x000030B4
    Import Name Table:                  0x000036E0
    Time Date Stamp:                    0x00000000
    Index of first forwarder reference: 0x00000000

    0x00003968      2525   _GDALAllRegister at 0
    0x00003956      2140   OGRRegisterAll
    0x00003934      2572   _GDALGeneralCmdLineProcessor at 12

etc. and yes (from C API headers):
 
void CPL_DLL CPL_STDCALL GDALAllRegister( void );
void CPL_DLL OGRRegisterAll(void);

as was predictable...

Cheers,

Ari

>
>   
-- 
Prof. Ari Jolma
Geoinformaatio- ja paikannustekniikka / Geoinformation and positioning
Teknillinen Korkeakoulu / Helsinki University of Technology
tel: +358 9 451 3886 address: POBox 1200, 02015 TKK, Finland
Email: ari.jolma at tkk.fi URL: http://www.tkk.fi/~jolma




More information about the gdal-dev mailing list