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

Frank Warmerdam warmerdam at pobox.com
Tue Feb 12 16:45:47 EST 2008


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

Ari,

I'm not sure what the pexports and dlltool stuff is for.  I have
found I can link MingGW applications directly against gdal_i.lib
without any special stuff.

> 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*)'

I'm at a bit of a loss on this one.

> (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"

I'm not too sure about this either.

> 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.

Is it possible you are trying to build GDAL "trunk" bindings?  The
packaged version in OSGeo4W is the 1.5.0 release and lacks the new
OSRSetLinearUnitsAndUpdateParameters() function.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org



More information about the gdal-dev mailing list