[geos-devel] Compiling GEOS on win32

Mateusz Loskot mateusz at loskot.net
Thu Jul 27 07:58:11 EDT 2006

Theuns Heydenrych wrote:
> hi I am a newby with GEOS
> I installed svn and downloaded the latest code with svn. When
> compiling the source with nmake i get the following errors.
> Microsoft (R) Program Maintenance Utility   Version 6.00.8168.0 
> Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
> copy ..\capi\geos_c.h.vc ..\capi\geos_c.h 1 file(s) copied. cl
> -Iheaders /MD /GR /O2 /D "NDEBUG" /nologo  /D "NOMINMAX" /D "WIN32_LE
>  AN_AND_MEAN" /D "NOGDI"  /GX /c algorithm\CGAlgorithms.cpp 
> /Foalgorithm\CGAlgori thms.obj CGAlgorithms.cpp 
> algorithm\CGAlgorithms.cpp(342) : error C2039: 'min' : is not a
> member of 'std' algorithm\CGAlgorithms.cpp(342) : error C2065: 'min'
> : undeclared identifier algorithm\CGAlgorithms.cpp(343) : error
> C2039: 'min' : is not a member of 'std' 
> algorithm\CGAlgorithms.cpp(344) : error C2039: 'min' : is not a
> member of 'std' algorithm\CGAlgorithms.cpp(350) : error C2039: 'min'
> : is not a member of 'std' algorithm\CGAlgorithms.cpp(351) : error
> C2039: 'min' : is not a member of 'std' 
> algorithm\CGAlgorithms.cpp(352) : error C2039: 'min' : is not a
> member of 'std' NMAKE : fatal error U1077: 'cl' : return code '0x2' 
> Stop.
> Is it posible to compile the code with Mingw32 and MSYS perhaps?

But you're not compiling with MinGW, are you?

>From the output above I see you're using VC++ 6, which is broken.
Honestly, VC++ is an evil if you're playing with C++.

Back to the problem, here you have the explanation:

Simply, std::min and std::max simply don't exist in the VC6 version of
STL, because it's a very old and not ISO C++ Standard compliant STL.

AFAIR, you won't be able to build GEOS using Visual C++ 6.0.
For example, geos uses in-place initialization of static const integer
data members, what feature is not supported by VC++ < 7.1 (Visual C++ 2003).

FYI, Recommended version of C++ compiler from Microsoft starts from
Visual C++ 2003 (7.1).

Best regards
Mateusz Loskot

More information about the geos-devel mailing list