[gdal-dev] [Windows/ C#] Gdal dll conflicts

Jerome Siot jerome.siot at maxsea.fr
Tue Mar 15 07:32:39 PDT 2016


Hello,
I'm currently deploying a Gdal-based application on various Windows-PCs.

For some of them, there are integration problems, due to dll conflicts. As an example:


1)      Here is my app directory structure :

MyApp
  |
  |-- gdal
  |    |
  |    |- gdal201.dll
  |    |- libeay32.dll
  |    |- ssleay32.dll
  |    |- ...
  |
  |-- myApp.exe
  |-- othersDll.dll


2)      On some of the PCs I use, libeay32.dll and ssleay32.dll are also present on C:\Windows\SysWOW64 folder, in versions different from mines.

3)      When the app loads gdal201.dll, dependencies are loaded first in C:\Windows\SysWOW64 folder ==> C:\Windows\SysWOW64 \libeay32.dll and ssleay32.dll are loaded, that causes a crash.

I checked that :

-          In GdalConfiguration.cs, GdalConfiguration(), my PATH env var is correctly overriden
var gdalPath = Path.Combine(executingDirectory, "gdal-2.0.1");
var nativePath = Path.Combine(gdalPath, GetPlatform());

// Prepend native path to environment path, to ensure the
// right libs are being used.
var path = Environment.GetEnvironmentVariable("PATH");
path = nativePath + ";" + Path.Combine(nativePath, "plugins") + ";" + path;
Environment.SetEnvironmentVariable("PATH", path);


-          Using a file access monitoring tool (ProcessMonitor, from Microsoft), I observe that dll search order is :

o   myApp.exe directory

o   C:\windows\ SysWOW64

o   C:\windows\System32

o   C:\...\MyApp\gdal-2.0.1

ð  This is not compliant with PATH overriding

After browsing internet (including the mailing-list :)), I don't want to :

-          Compile gdal statically,

-          Copy gdal dependencies in myApp.exe root directory,

-          Comment some lines of my makefile in order to avoid dependencies such as libeay32.dll or ssleay32.dll.


Have you got ideas about this problem ?

--
Thank you, Jérome Siot

(Excuse me for my awful English, I'm French !)











--
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20160315/732ed194/attachment-0001.html>


More information about the gdal-dev mailing list