[gdal-dev] Link GDAL with MinGW

Ari Jolma ari.jolma at tkk.fi
Thu Feb 26 08:14:49 EST 2009


oops, I believe it is not correct to say "Swig bindings use some C++ 
API", but it is nevertheless sometimes hard/not possible to mix VC and 
MinGW when developing for Windows

Ari

Ari Jolma kirjoitti:
> MinGW gcc generates .dll.a files, which are the link libraries, but it 
> can also use the plain dll to link against.
>
> However, when you mention gdal16.dll, it sounds like you're trying to 
> link against a GDAL dll that was generated with VC. The C++ API is 
> very difficult to use from such dll when you're developing with MinGW 
> if not impossible. I, for one, have never succeeded. The Swig bindings 
> use some C++ API, which have so far prevented me from using "an 
> official" binary gdal dll for the Perl bindings for example.
>
> Ari
>
> LF kirjoitti:
>> Hi to everyone,
>> I'm trying to make a plugin for GDAL. So I need to use some 
>> GDALDataset methods
>> (AddBand, GetDriver, setGCPs, ...).
>> When I compile my code with MinGW it's all OK, but when MinGW starts 
>> linking it
>> doesn't found these methods and give me "undefined reference" to all 
>> them.
>> In makefile I added to LNK_FLAGS variable both gdal16.dll and its 
>> path. I tried
>> to use gdal_i.lib of 1.5 version too, but nothing appened.
>> If it's useful I copy CPP_FLAGS following:
>>
>> CPPFLAGS:=-Wall -DCSK_PLUGIN -fPIC $(GDAL_INCLUDE) $(HDF5_INCLUDE) 
>> $(CPPFLAGS)
>> CPPFLAGS:= -DH5_HAVE_HIGH_LEVEL_API $(CPPFLAGS)
>> CPPFLAGS:= -DWIN32 -DDLL_EXPORT -DPIC $(CPPFLAGS)
>>
>>
>> _______________________________________________
>> gdal-dev mailing list
>> gdal-dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>>   
>
>


-- 
Prof. Ari Jolma
Environmental Management Information Technology
Teknillinen Korkeakoulu / Helsinki University of Technology
tel: +358 9 4511 address: POBox 5300, 02015 TKK, Finland
Email: ari.jolma at tkk.fi URL: http://geoinformatics.tkk.fi



More information about the gdal-dev mailing list