[gdal-dev] Linking MinGW app builds against VC++ built GDAL

Ari Jolma ari.jolma at tkk.fi
Tue Feb 12 15:26:35 EST 2008


Frank Warmerdam kirjoitti:
> Ari Jolma wrote:
>> Frank,
>>
>> I'd like to try this, i.e., build the Perl bindings with MinGW 
>> against such DLL. But since I'm not willing to build GDAL DLL with 
>> VC++, I'd need to download them from someplace. Can I?
>
> Ari,
>
> Absolutely!  Just download:
>
>   http://download.osgeo.org/osgeo4w/setup.exe
>

Got it. I made MinGW lib files with pexports and dlltool (similarly as 
in http://trac.osgeo.org/gdal/wiki/BuildingWithMinGW) and stabbed 
Makefile.PL to use that and the include files from /cygwin/include, but 
no immediate luck. Only gdal_const compiles, gdal complains:

gdal_wrap.cpp: In function `void _wrap_Driver_CreateCopy(CV*)':
gdal_wrap.cpp:4818: error: invalid conversion from `int (*)(double, 
const char*, void*)' to `int (*)(double, const char*, void*)'

(there are more similar complaints), the error seems to be from the 
code, which converts C callbacks to Perl callbacks. The error seems to 
be "invalid conversion from a to a"(!?!)

ogr compiles but complains zillion times in the link phase:

ogr_wrap.o:ogr_wrap.cpp:(.text+0x17331): undefined reference to 
`CPLGetLastErrorMsg at 0'

i.e. only from those which have "@0"

and osr complains:

osr_wrap.cpp: In function `OGRErr 
OSRSpatialReferenceShadow_SetLinearUnitsAndUpdateParameters(OSRSpatialReferenceShadow*, 
const char*, double)':
osr_wrap.cpp:1812: error: `OSRSetLinearUnitsAndUpdateParameters' 
undeclared (first use this function)

and a few similar ones.

Ari




More information about the gdal-dev mailing list