[gdal-dev] How to use GDAL C++ dynamically?

Frank Warmerdam warmerdam at pobox.com
Wed Feb 23 14:12:49 EST 2011


On 11-02-22 05:52 PM, Mikhail Tchernychev wrote:
> This is what I normally do, however it's not much less pain, even it's simple.
> I typically write a wrapper to execute all GetProcAdress() functions at once
> and store
> pointers in the class.
>
> Taking into number of GDAL functions, its' would be very challenging.
>
> Mikhail
>
> On 2/22/2011 2:43 PM, Even Rouault wrote:
>> Le mardi 22 février 2011 23:14:50, Mikhail Tchernychev a écrit :
>>> Hello List,
>>>
>>> I wonder if someone could point me into the right direction. I would
>>> like to use
>>> GDAL as loaded DLL at run time, with LoadLibray() call under windows
>>> and corresponding
>>> calls under Linux. I see that most of the functions are virtual, so it
>>> seems it is made
>>> with this in mind. I am trying to compile simple program:
>> I think you are going to inflict you a lot of pain with LoadLibrary() and C++
>> API at the same time !
>>
>> If you really need to dynamicly load gdal, use the GDAL C API instead...


Folks,

I will note that at one time I maintained a "bridge" mechanism which
basically did this.  It dynamically loaded the C API at runtime.  I
stopped maintaining it several years ago but you can still find it in
old code branches.

ie.

http://svn.osgeo.org/gdal/tags/gdal_1_2_0/bridge/

If someone felt it was really useful, that might be a good place to
start.

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    | Geospatial Programmer for Rent



More information about the gdal-dev mailing list