[gdal-dev] 1.4.4 Preliminary Win32 Binaries

Mateusz Loskot mateusz at loskot.net
Mon Nov 26 06:10:09 EST 2007


Ari Jolma wrote:
> 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).

DLL built with MingGW will be usable with Visual C++ (and vice versa)
only if separete/dedicated import libraries are prepared. Having .DEF file
it's easier than not having it, but still, dedicated binary is required.

> But I'm
> still puzzled why _Foo at 0 syntax is needed *only* for some functions?

Mangling is required for C++ functions, class members functions,
overloaded functions.

Cheers
-- 
Mateusz Loskot
http://mateusz.loskot.net


More information about the gdal-dev mailing list