Hi List.<br>I&#39;m again here ;)<br><br>Today I re-built GDAL with ECW support (for windows XP). <br>After spending some hours in the attempt of building it using a Visual Studio .Net solution (Although I attempted to add all required Include, Libs, and options, I encountered a lot of problems with NCS related files) I finally used a simple NMAKE and I built it in 5 minutes. 
<br><br>Now, I&#39;m fighting again with the old problem :) (related to MrSID support)  <br>Thus, I&#39;m really sorry bothering you with my old question:<br><br>Any suggestion to build  <span id="st" name="st" class="st">
GDAL</span> using NMAKE without the error &quot;CPLRealloc(): Out of memory allocating N bytes&quot; occurring when reading some MrSID files from Java?<br>^_^.<br><br>Best Regards<br>Daniele<br><br><br><div><span class="gmail_quote">
On 6/28/07, <b class="gmail_sendername">Daniele Romagnoli</b> &lt;<a href="mailto:dany.geotools@gmail.com">dany.geotools@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi list,<br>I encountered a strange error when using <span id="st" name="st" class="st">GDAL</span>&#39;s <span id="st" name="st" class="st">MrSID</span> driver from Java.<br>(My system is Windows XP with Visual Studio .Net 2003)
<br><br>I built <span id="st" name="st" class="st">GDAL</span> from SVN (I&#39;m using the revision 11339) using NMAKE.
<br><br>I written an ImageIO plugin for loading and reading <span id="st" name="st" class="st">MrSID</span> data sources.<br>This is a typical code in my plugin:<br>-------------------------------------------------------------------------------------------
<br>...
<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dataset ds = <span id="st" name="st" class="st">gdal</span>.Open(String name, int accessType);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // trivial operations (getting Driver and Driver&#39;s description).<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ds.delete();<br>}<br>...<br>// trivial operations
<br>...<br>{<br>&nbsp;...<br>&nbsp;Dataset ds = <span id="st" name="st" class="st">gdal</span>.Open(String name, int accessType);<br>&nbsp;...<br>}<br>-------------------------------------------------------------------------------------------------------------------------------------------------------------
<br>I noticed that on some <span id="st" name="st" class="st">MrSID</span> data samples, when calling the Open method the second time, this error will occur:<br>Error2 CPLRealloc(): Out of memory allocating 10 bytes.<br>
<br>It is thrown when <span id="st" name="st" class="st">MrSID</span> parses metadata on 
mrsiddataset.cpp:<br>pszMetadata = (char *)CPLRealloc( pszMetadata, iLength );<br><br>To solve this problem, I built <span id="st" name="st" class="st">GDAL</span> using a Visual Studio Solution (with <span id="st" name="st" class="st">
MrSID</span> support properly configured) and the error magically disappears.
<br><br>Any suggestion to build <span id="st" name="st" class="st">GDAL</span> using NMAKE without this error?<br>(I already attempted a NMAKE clean ...)<br><br>Thank you very much.<br><br>-- <br>Best Regards,<br><span class="sg">
Daniele Romagnoli
</span></blockquote></div><br><br clear="all"><br>-- <br>Best Regards,<br>Daniele Romagnoli