[gdal-dev] GDAL_DRIVER_PATH dll hell

Even Rouault even.rouault at mines-paris.org
Thu May 15 04:43:06 PDT 2014


Selon Dmitriy Baryshnikov <bishop.dev at gmail.com>:

> Hi,
>
> Yesterday I faced interesting problem on Win7 64 bit.
> My program uses last gdal version 1.12. During start the error message
> popuped in dialog that gdal v. 1.8 was not find and application closed.
> I checked with dependency walker what were was no gdal 1.8 dependency in
> application and all it dll's.
> I found out that another program used the gdal 1.8  was installed on
> that PC. And this program create env variable GDAL_DRIVER_PATH which
> pointed on some non standard driver linked with gdal 1.8
> My gdal 1.12 try to load this driver as GDAL_DRIVER_PATH was present and
> crush as it was linked with gdal 1.8.
> I solved it by setting CPLSetConfigOption("GDAL_DRIVER_PATH",
> "disabled"); in my application, but this is not a good solution.
> I think some version checking needed or something else. Anyhow I think
> this is bug.
> That do you think about this?
> If this is a bug I'll create ticket.

I don't think there's a way to prevent this. GDAL 1.12 will logically try to
load drivers that are in GDAL_DRIVER_PATH, and if the plugins in there link with
any DLL, the Windows mechanisms will try to load that DLL.
Well, perhaps there's a way of putting some "metadata" in the DLL that you could
inspect before loading it, but I don't know Windows well enough to tell.

>
> --
> Best regards,
>      Dmitry
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>




More information about the gdal-dev mailing list