<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Courier New";
        mso-fareast-language:FR;}
span.EmailStyle20
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:166603458;
        mso-list-type:hybrid;
        mso-list-template-ids:-2047424744 67895313 67895321 67895323 67895311 67895321 67895323 67895311 67895321 67895323;}
@list l0:level1
        {mso-level-text:"%1\)";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l1
        {mso-list-id:258493759;
        mso-list-type:hybrid;
        mso-list-template-ids:1986435544 310296854 67895299 1795716786 67895297 67895299 67895301 67895297 67895299 67895301;}
@list l1:level1
        {mso-level-start-at:2;
        mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:.75in;
        text-indent:-.25in;
        font-family:"Calibri",sans-serif;
        mso-fareast-font-family:Calibri;
        mso-bidi-font-family:"Times New Roman";}
@list l1:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:1.25in;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l1:level3
        {mso-level-start-at:2;
        mso-level-number-format:bullet;
        mso-level-text:\F0F0;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:1.75in;
        text-indent:-.25in;
        font-family:Wingdings;
        mso-fareast-font-family:Calibri;
        mso-bidi-font-family:"Times New Roman";}
@list l1:level4
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:2.25in;
        text-indent:-.25in;
        font-family:Symbol;}
@list l1:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:2.75in;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l1:level6
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:3.25in;
        text-indent:-.25in;
        font-family:Wingdings;}
@list l1:level7
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:3.75in;
        text-indent:-.25in;
        font-family:Symbol;}
@list l1:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:4.25in;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l1:level9
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:4.75in;
        text-indent:-.25in;
        font-family:Wingdings;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="FR" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hello,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I’m currently deploying a Gdal-based application on various Windows-PCs.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">For some of them, there are integration problems, due to dll conflicts. As an example:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo2"><![if !supportLists]><span lang="EN-US"><span style="mso-list:Ignore">1)<span style="font:7.0pt "Times New Roman"">     
</span></span></span><![endif]><span lang="EN-US">Here is my app directory structure :<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">MyApp<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">  |<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">  |-- gdal<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">  |    |<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">  |    |- gdal201.dll<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">  |    |- <b>libeay32.dll</b><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">  |    |- <b>ssleay32.dll</b><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">  |    |- ...<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">  |<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">  |-- myApp.exe<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">  |-- othersDll.dll<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo2"><![if !supportLists]><span lang="EN-US"><span style="mso-list:Ignore">2)<span style="font:7.0pt "Times New Roman"">     
</span></span></span><![endif]><span lang="EN-US">On some of the PCs I use, libeay32.dll and ssleay32.dll are also present on
<b>C:\Windows\SysWOW64</b> folder, in versions different from mines.<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo2"><![if !supportLists]><span lang="EN-US"><span style="mso-list:Ignore">3)<span style="font:7.0pt "Times New Roman"">     
</span></span></span><![endif]><span lang="EN-US">When the app loads gdal201.dll, dependencies are loaded first in
<b>C:\Windows\SysWOW64</b> folder </span><span lang="EN-US" style="font-family:Wingdings">è</span><span lang="EN-US">
<b>C:\Windows\SysWOW64</b> \libeay32.dll and ssleay32.dll are loaded, that causes a crash.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I checked that :<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:.75in;text-indent:-.25in;mso-list:l1 level1 lfo4">
<![if !supportLists]><span lang="EN-US"><span style="mso-list:Ignore">-<span style="font:7.0pt "Times New Roman"">         
</span></span></span><![endif]><span lang="EN-US">In GdalConfiguration.cs, GdalConfiguration(), my PATH env var is correctly overriden<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;background:white"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:blue;mso-fareast-language:FR">var</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:FR"> gdalPath = </span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#2B91AF;mso-fareast-language:FR">Path</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:FR">.Combine(executingDirectory, </span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#A31515;mso-fareast-language:FR">"gdal-2.0.1"</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:FR">);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;background:white"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:blue;mso-fareast-language:FR">var</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:FR"> nativePath = </span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#2B91AF;mso-fareast-language:FR">Path</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:FR">.Combine(gdalPath, GetPlatform());<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;background:white"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:FR"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;background:white"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:green;mso-fareast-language:FR">// Prepend native path to environment path, to ensure the</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:FR"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;background:white"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:green;mso-fareast-language:FR">// right libs are being used.</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:FR"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;background:white"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:blue;mso-fareast-language:FR">var</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:FR"> path = </span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#2B91AF;mso-fareast-language:FR">Environment</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:FR">.GetEnvironmentVariable(</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#A31515;mso-fareast-language:FR">"PATH"</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:FR">);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;background:white"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:FR">path = nativePath + </span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#A31515;mso-fareast-language:FR">";"</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:FR"> + </span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#2B91AF;mso-fareast-language:FR">Path</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:FR">.Combine(nativePath, </span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#A31515;mso-fareast-language:FR">"plugins"</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:FR">) + </span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#A31515;mso-fareast-language:FR">";"</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:FR"> + path;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;background:white"><span style="font-size:10.0pt;font-family:Consolas;color:#2B91AF;mso-fareast-language:FR">Environment</span><span style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:FR">.SetEnvironmentVariable(</span><span style="font-size:10.0pt;font-family:Consolas;color:#A31515;mso-fareast-language:FR">"PATH"</span><span style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:FR">, path);<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;background:white"><span style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:FR"><o:p> </o:p></span></p>
<p class="MsoListParagraph" style="margin-left:.75in;text-indent:-.25in;mso-list:l1 level1 lfo4">
<![if !supportLists]><span lang="EN-US"><span style="mso-list:Ignore">-<span style="font:7.0pt "Times New Roman"">         
</span></span></span><![endif]><span lang="EN-US">Using a file access monitoring tool (ProcessMonitor, from Microsoft), I observe that dll search order is :<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:1.25in;text-indent:-.25in;mso-list:l1 level2 lfo4">
<![if !supportLists]><span lang="EN-US" style="font-family:"Courier New""><span style="mso-list:Ignore">o<span style="font:7.0pt "Times New Roman"">  
</span></span></span><![endif]><span lang="EN-US">myApp.exe directory<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:1.25in;text-indent:-.25in;mso-list:l1 level2 lfo4">
<![if !supportLists]><span lang="EN-US" style="font-family:"Courier New""><span style="mso-list:Ignore">o<span style="font:7.0pt "Times New Roman"">  
</span></span></span><![endif]><span lang="EN-US">C:\windows\<b> SysWOW64</b><o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:1.25in;text-indent:-.25in;mso-list:l1 level2 lfo4">
<![if !supportLists]><span lang="EN-US" style="font-family:"Courier New""><span style="mso-list:Ignore">o<span style="font:7.0pt "Times New Roman"">  
</span></span></span><![endif]><span lang="EN-US">C:\windows\System32<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:1.25in;text-indent:-.25in;mso-list:l1 level2 lfo4">
<![if !supportLists]><span lang="EN-US" style="font-family:"Courier New""><span style="mso-list:Ignore">o<span style="font:7.0pt "Times New Roman"">  
</span></span></span><![endif]><span lang="EN-US">C:\...\MyApp\gdal-2.0.1<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:1.75in;text-indent:-.25in;mso-list:l1 level3 lfo4">
<![if !supportLists]><span lang="EN-US" style="font-family:Wingdings"><span style="mso-list:Ignore">ð<span style="font:7.0pt "Times New Roman""> 
</span></span></span><![endif]><span lang="EN-US">This is not compliant with PATH overriding<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">After browsing internet (including the mailing-list
</span><span lang="EN-US" style="font-family:Wingdings">J</span><span lang="EN-US">), I don’t want to :<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:.75in;text-indent:-.25in;mso-list:l1 level1 lfo4">
<![if !supportLists]><span lang="EN-US"><span style="mso-list:Ignore">-<span style="font:7.0pt "Times New Roman"">         
</span></span></span><![endif]><span lang="EN-US">Compile gdal statically,<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:.75in;text-indent:-.25in;mso-list:l1 level1 lfo4">
<![if !supportLists]><span lang="EN-US"><span style="mso-list:Ignore">-<span style="font:7.0pt "Times New Roman"">         
</span></span></span><![endif]><span lang="EN-US">Copy gdal dependencies in myApp.exe root directory,<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:.75in;text-indent:-.25in;mso-list:l1 level1 lfo4">
<![if !supportLists]><span lang="EN-US"><span style="mso-list:Ignore">-<span style="font:7.0pt "Times New Roman"">         
</span></span></span><![endif]><span lang="EN-US">Comment some lines of my makefile in order to avoid dependencies such as
<b>libeay32.dll or ssleay32.dll.</b><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Have you got ideas about this problem ?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">--<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Thank you, Jérome Siot<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">(Excuse me for my awful English, I’m French !)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoListParagraph" style="margin-left:.75in;background:white"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:FR"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">--<o:p></o:p></span></p>
</div>
</body>
</html>