<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body>
Hi,<br>
<br>
I have just downloaded <a
 href="http://geos.refractions.net/geos-1.0.0.tar.gz">geos-1.0.0.tar.gz</a>,
and compiled it under VC++6. I have not tested it yet (it lacks the
test suite of JTS), so be warned, the modifications I had to do may
have unwanted side-effects....<br>
<br>
Here is how I proceeded:<br>
<ul>
  <li>Create a project under VC6 (a static lib is easier for now, you
will not need to define the DLL exported symbols).</li>
</ul>
<ul>
  <li>add all the cpp files to your project.</li>
</ul>
<ul>
  <li>in "Project Settings" / Tab "C/C++" / Category "C++ language"
enable Run-Time Type Information (RTTI) or add the /GR flag to the
compiler options, so you will be able to do things like <code>dynamic_cast&lt;...&gt;</code><br>
  </li>
</ul>
<ul>
  <li>&nbsp;in platform.h, undefine H<tt>AVE_LONG_LONG_INT_64</tt> (I have
not checked the implications of this...)</li>
</ul>
<ul>
  <li>VC6 complains about symbol redefinition (error C2374) when two
contiguous loops use the same loop index identifier, eg:</li>
</ul>
<blockquote><tt>for(int i=0; ...) {...}</tt><br>
  <tt>for(int i=0; ...) {...}</tt><br>
</blockquote>
<blockquote>The solution is to rename the second loop index (<code>j</code>
seems a good choice :-), or to upgrade to a more C++ compliant
compiler... be carefull to rename all the occurences of i within the
loop scope.<br>
</blockquote>
<ul>
  <li>There are a *LOT* of <font>C4786 </font>warnings "identifier
was truncated to 255 characters in the debug information", so use <code>#pragma
warning(disable:4786)</code> to disable it (or disable all warnings,
but you may want to see other warnings)</li>
</ul>
<ul>
  <li>I had the following compilation error: "C2248: 'IntersectsOp' :
cannot access protected class declared in class
'geos::AbstractSTRtree'" that I resolved by making the IntersectOp
inner class public. I am not a C++ standard specialist (in fact I am a
Java guy), but I was surprised it did not compile...</li>
</ul>
<ul>
  <li>In PolygonBuilder.cpp, the following line did not compile:</li>
</ul>
<blockquote><tt><code>freeHoleList-&gt;insert(freeHoleList-&gt;end(),minEdgeRings-&gt;begin(),minEdgeRings-&gt;end());</code></tt><br>
</blockquote>
<blockquote>The MS STL implementation bundled with VC6 is not the best
you can find. You may want to try STLPort (<a class="moz-txt-link-abbreviated" href="http://www.stlport.org">www.stlport.org</a>). If this
sounds too complicated for you, I think the following lines are
equivalent (if it is not, please tell me):<br>
</blockquote>
<blockquote><code><tt>vector&lt;MinimalEdgeRing*&gt;::iterator end =
minEdgeRings-&gt;end();</tt></code><br>
  <code><tt>for(vector&lt;MinimalEdgeRing*&gt;::iterator
it=minEdgeRings-&gt;begin(); it!=end; it++)</tt></code><br>
  <code><tt>{</tt></code><br>
  <code><tt>&nbsp;&nbsp;&nbsp; freeHoleList-&gt;push_back(*it);</tt></code><br>
  <code><tt>}<br>
  </tt></code></blockquote>
<ul>
  <li>strangely, VC6 does not know about min() and max() functions, so
use <code>#define min __min</code> and <code>#define max __max</code><br>
  </li>
</ul>
Here we are. I think you should be able to compile now, unless I have
forgotten to mension some other problem. If you need to stick to C++,
maybe should you upgrade to Visual C++ .NET, I have heard it is much
more C++ compliant than VC++6, and maybe it is bundled with a more
complete STL implementation.<br>
<br>
Or switch to Java, and use JTS :-)&nbsp; If I manage to realize some
performance tests with GEOS, I will compare them with their equivalent
in JTS, but I am quite sure that Java will be quite as fast as C++, the
latest Java virtual machines being indeed really fast.<br>
<br>
Regards,<br>
<br>
Herv&eacute;<br>
<br>
<br>
<br>
Swapna kv wrote:
<blockquote cite="midSea1-F103cncTU4DYo600023f38@hotmail.com"
 type="cite"><br>
Hi
  <br>
  <br>
&nbsp;&nbsp; Has anyone succesfully built GEOS on Windows platform using VC. We
have been unable to do so. Can anyone give any pointers / VC project
files to help us do so.
  <br>
  <br>
  <br>
Regards
  <br>
Swapna
  <br>
  <br>
  <br>
</blockquote>
<br>
</body>
</html>