[geos-devel] C API busted for Windows
Paul Ramsey
pramsey at refractions.net
Tue Nov 14 12:17:42 EST 2006
Have these been tested recently? I want to isolate my f***ups last week
from the general drift of the library since the last time someone worked
on the windows side.
Howard Butler wrote:
> This solution is not so pleasant for the svn developer types (go to a
> gnu system and autogen.sh/configure and copy the file or hand tweak and
> copy the file), but we can cope I suppose.
>
> The C API is still pretty busted on Windows though.
>
> - Both the .cpp and .h files are doing extern "C", which MSVC doesn't like:
>
>> ..\capi\geos_c.cpp(124) : error C2733: second C linkage of overloaded
>> function '
>> GEOSDisjoint' not allowed
>> ..\capi\geos_c.cpp(123) : see declaration of 'GEOSDisjoint'
>> ..\capi\geos_c.cpp(145) : error C2733: second C linkage of overloaded
>> function '
>> GEOSTouches' not allowed
>> ..\capi\geos_c.cpp(144) : see declaration of 'GEOSTouches'
>> ..\capi\geos_c.cpp(167) : error C2733: second C linkage of overloaded
>> function '
>> GEOSIntersects' not allowed
>> ..\capi\geos_c.cpp(166) : see declaration of 'GEOSIntersects'
>> ..\capi\geos_c.cpp(189) : error C2733: second C linkage of overloaded
>> function '
>> GEOSCrosses' not allowed
> (goes on throughout the rest of the file)
> -If I drop the extern "C" in the .cpp file, other insanity ensues:
>
>> d:\cvs\buildkit\geos\capi\geos_c.h(49) : warning C4005:
>> 'GEOS_VERSION_PATCH' : macro redefinition
>> headers\geos\version.h(6) : see previous definition of
>> 'GEOS_VERSION_PATCH'
>> d:\cvs\buildkit\geos\capi\geos_c.h(50) : warning C4005: 'GEOS_VERSION'
>> : macro redefinition
>> ..\capi\geos_c.cpp(495) : error C2556: 'geos::geom::Geometry
>> *GEOSGeomFromWKT(const char *)' : overloaded function differs only by
>> return type from 'GEOSGeom GEOSGeomFromWKT(const char *)'
>> d:\cvs\buildkit\geos\capi\geos_c.h(113) : see declaration of
>> 'GEOSGeomFromWKT'
>> ..\capi\geos_c.cpp(495) : error C2371: 'GEOSGeomFromWKT' :
>> redefinition; different basic types
>> d:\cvs\buildkit\geos\capi\geos_c.h(113) : see declaration of
>> 'GEOSGeomFromWKT'
>> ..\capi\geos_c.cpp(577) : error C2556: 'geos::geom::Geometry
>> *GEOSGeomFromWKB_buf(const unsigned char *,size_t)' : overloaded
>> function differs only by return type from 'GEOSGeom
>> GEOSGeomFromWKB_buf(const unsigned char *,size_t)'
>> d:\cvs\buildkit\geos\capi\geos_c.h(130) : see declaration of
>> 'GEOSGeomFromWKB_buf'
>> ..\capi\geos_c.cpp(577) : error C2371: 'GEOSGeomFromWKB_buf' :
>> redefinition; different basic types
>> d:\cvs\buildkit\geos\capi\geos_c.h(130) : see declaration of
>> 'GEOSGeomFromWKB_buf'
>> ..\capi\geos_c.cpp(639) : error C2556: 'geos::geom::Geometry
>> *GEOSGeomFromHEX_buf(const unsigned char *,size_t)' : overloaded
>> function differs only by return type from 'GEOSGeom
>> GEOSGeomFromHEX_buf(const unsigned char *,size_t)'
>> d:\cvs\buildkit\geos\capi\geos_c.h(133) : see declaration of
>> 'GEOSGeomFromHEX_buf'
>> ..\capi\geos_c.cpp(639) : error C2371: 'GEOSGeomFromHEX_buf' :
>> redefinition; different basic types
>> d:\cvs\buildkit\geos\capi\geos_c.h(133) : see declaration of
>> 'GEOSGeomFromHEX_buf'
>> ..\capi\geos_c.cpp(1461) : error C2556:
>> 'geos::geom::CoordinateSequence *GEOSCoordSeq_create(unsigned
>> int,unsigned int)' : overloaded function differs only by return type
>> from 'GEOSCoordSeq GEOSCoordSeq_create(size_t,size_t)'
>> d:\cvs\buildkit\geos\capi\geos_c.h(147) : see declaration of
>> 'GEOSCoordSeq_create'
>> ..\capi\geos_c.cpp(1461) : error C2371: 'GEOSCoordSeq_create' :
>> redefinition; different basic types
>> d:\cvs\buildkit\geos\capi\geos_c.h(147) : see declaration of
>> 'GEOSCoordSeq_create'
>
> Howard
>
>
>
> At 11:43 PM 11/10/2006, Paul Ramsey wrote:
>> Sorry, I must have copied the vanilla .h file over the .vc file at
>> some point while juggling things to get the .vc into a .in where it
>> would get versions macro-substituted. I've dredged the original back
>> out of the revision. Getting the .vc from the .vc.in does require a
>> 'make dist' on a gnu system first. The svn snapshot will have the
>> generated file.
>>
>> P
>>
>> On 10-Nov-06, at 1:50 PM, Howard Butler wrote:
>>
>>> D:\cvs\PCL\PCL-Core>python setup.py build
>>> running build
>>> running build_py
>>> running build_ext
>>> building 'cartography.geometry._geom' extension
>>> C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.exe / c
>>> /nologo /Ox
>>> /MD /W3 /GX /DNDEBUG -Id:\cvs\buildkit\geos\capi -Id:\cvs\buildkit
>>> \proj-4.4.9\s
>>> rc -IC:\Python24\include -IC:\Python24\PC /Tccartography/geometry/
>>> _geommodule.c
>>> /Fobuild\temp.win32-2.4\Release\cartography/geometry/_geommodule.obj
>>> _geommodule.c
>>> d:\cvs\buildkit\geos\capi\geos_c.h(134) : error C2059: syntax
>>> error : 'type'
>>> d:\cvs\buildkit\geos\capi\geos_c.h(151) : error C2059: syntax
>>> error : 'type'
>>> d:\cvs\buildkit\geos\capi\geos_c.h(154) : error C2059: syntax
>>> error : 'type'
>>> d:\cvs\buildkit\geos\capi\geos_c.h(168) : error C2059: syntax
>>> error : 'type'
>>> d:\cvs\buildkit\geos\capi\geos_c.h(174) : error C2059: syntax
>>> error : 'type'
>>> d:\cvs\buildkit\geos\capi\geos_c.h(225) : error C2059: syntax
>>> error : 'type'
>>> d:\cvs\buildkit\geos\capi\geos_c.h(226) : error C2059: syntax
>>> error : 'type'
>>> d:\cvs\buildkit\geos\capi\geos_c.h(227) : error C2059: syntax
>>> error : 'type'
>>> d:\cvs\buildkit\geos\capi\geos_c.h(234) : error C2059: syntax
>>> error : 'type'
>>> d:\cvs\buildkit\geos\capi\geos_c.h(236) : error C2059: syntax
>>> error : 'type'
>>> d:\cvs\buildkit\geos\capi\geos_c.h(239) : error C2059: syntax
>>> error : 'type'
>>> d:\cvs\buildkit\geos\capi\geos_c.h(256) : error C2059: syntax
>>> error : 'type'
>>> d:\cvs\buildkit\geos\capi\geos_c.h(257) : error C2059: syntax
>>> error : 'type'
>>> d:\cvs\buildkit\geos\capi\geos_c.h(258) : error C2059: syntax
>>> error : 'type'
>>> d:\cvs\buildkit\geos\capi\geos_c.h(260) : error C2059: syntax
>>> error : 'type'
>>> d:\cvs\buildkit\geos\capi\geos_c.h(261) : error C2059: syntax
>>> error : 'type'
>>> d:\cvs\buildkit\geos\capi\geos_c.h(262) : error C2059: syntax
>>> error : 'type'
>>> d:\cvs\buildkit\geos\capi\geos_c.h(264) : error C2059: syntax
>>> error : 'type'
>>> d:\cvs\buildkit\geos\capi\geos_c.h(265) : error C2059: syntax
>>> error : 'type'
>>> d:\cvs\buildkit\geos\capi\geos_c.h(266) : error C2059: syntax
>>> error : 'type'
>>> d:\cvs\buildkit\geos\capi\geos_c.h(267) : error C2059: syntax
>>> error : 'type'
>>> d:\cvs\buildkit\geos\capi\geos_c.h(274) : error C2059: syntax
>>> error : 'type'
>>> d:\cvs\buildkit\geos\capi\geos_c.h(277) : error C2059: syntax
>>> error : 'type'
>>> d:\cvs\buildkit\geos\capi\geos_c.h(278) : error C2059: syntax
>>> error : 'type'
>>> d:\cvs\buildkit\geos\capi\geos_c.h(279) : error C2059: syntax
>>> error : 'type'
>>> d:\cvs\buildkit\geos\capi\geos_c.h(344) : error C2059: syntax
>>> error : 'type'
>>> d:\cvs\buildkit\geos\capi\geos_c.h(357) : error C2059: syntax
>>> error : 'type'
>>> d:\cvs\buildkit\geos\capi\geos_c.h(364) : error C2059: syntax
>>> error : 'type'
>>> d:\cvs\buildkit\geos\capi\geos_c.h(373) : error C2059: syntax
>>> error : 'type'
>>> cartography\geometry\_geommodule.c(100) : warning C4013:
>>> 'GEOSCoordSeq_create' undefined; assuming extern returning int
>>> cartography\geometry\_geommodule.c(125) : warning C4013:
>>> 'GEOSCoordSeq_clone' undefined; assuming extern returning int
>>> cartography\geometry\_geommodule.c(125) : warning C4047: '=' :
>>> 'GEOSCoordSeq' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(179) : warning C4018: '>=' :
>>> signed/unsigned mismatch
>>> cartography\geometry\_geommodule.c(215) : warning C4018: '>=' :
>>> signed/unsigned mismatch
>>> cartography\geometry\_geommodule.c(251) : warning C4018: '>=' :
>>> signed/unsigned mismatch
>>> cartography\geometry\_geommodule.c(284) : warning C4018: '>=' :
>>> signed/unsigned mismatch
>>> cartography\geometry\_geommodule.c(319) : warning C4018: '>=' :
>>> signed/unsigned mismatch
>>> cartography\geometry\_geommodule.c(354) : warning C4018: '>=' :
>>> signed/unsigned mismatch
>>> cartography\geometry\_geommodule.c(482) : warning C4013:
>>> 'GEOSGeom_clone' undefined; assuming extern returning int
>>> cartography\geometry\_geommodule.c(482) : warning C4047: '=' :
>>> 'GEOSGeom' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(499) : warning C4013:
>>> 'GEOSGeomFromWKB_buf' undefined; assuming extern returning int
>>> cartography\geometry\_geommodule.c(499) : warning C4047: '=' :
>>> 'GEOSGeom' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(520) : warning C4047: '=' :
>>> 'GEOSGeom' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(546) : warning C4013:
>>> 'GEOSGeomFromWKT' undefined; assuming extern returning int
>>> cartography\geometry\_geommodule.c(546) : warning C4047: '=' :
>>> 'GEOSGeom' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(566) : warning C4047: '=' :
>>> 'GEOSGeom' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(613) : warning C4013:
>>> 'GEOSGeom_createPoint' undefined; assuming extern returning int
>>> cartography\geometry\_geommodule.c(613) : warning C4047: '=' :
>>> 'GEOSGeom' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(616) : warning C4013:
>>> 'GEOSGeom_createLineString' undefined; assuming extern returning int
>>> cartography\geometry\_geommodule.c(616) : warning C4047: '=' :
>>> 'GEOSGeom' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(619) : warning C4013:
>>> 'GEOSGeom_createLinearRing' undefined; assuming extern returning int
>>> cartography\geometry\_geommodule.c(619) : warning C4047: '=' :
>>> 'GEOSGeom' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(660) : warning C4047: '=' :
>>> 'GEOSCoordSeq' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(675) : warning C4047: '=' :
>>> 'GEOSGeom' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(678) : warning C4047: '=' :
>>> 'GEOSGeom' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(681) : warning C4047: '=' :
>>> 'GEOSGeom' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(721) : warning C4047: '=' :
>>> 'GEOSGeom' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(757) : warning C4013:
>>> 'GEOSGeom_createPolygon' undefined; assuming extern returning int
>>> cartography\geometry\_geommodule.c(757) : warning C4047: '=' :
>>> 'GEOSGeom' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(776) : warning C4047: '=' :
>>> 'GEOSGeom' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(823) : warning C4013:
>>> 'GEOSGeom_createCollection' undefined; assuming extern returning int
>>> cartography\geometry\_geommodule.c(823) : warning C4047: '=' :
>>> 'GEOSGeom' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(942) : warning C4013:
>>> 'GEOSEnvelope' undefined; assuming extern returning int
>>> cartography\geometry\_geommodule.c(942) : warning C4047: '=' :
>>> 'GEOSGeom' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(1272) : warning C4013:
>>> 'GEOSIntersection' undefined; assuming extern returning int
>>> cartography\geometry\_geommodule.c(1272) : warning C4047: '=' :
>>> 'GEOSGeom' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(1291) : warning C4013:
>>> 'GEOSBuffer' undefined; assuming extern returning int
>>> cartography\geometry\_geommodule.c(1291) : warning C4047: '=' :
>>> 'GEOSGeom' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(1305) : warning C4013:
>>> 'GEOSConvexHull' undefined; assuming extern returning int
>>> cartography\geometry\_geommodule.c(1305) : warning C4047: '=' :
>>> 'GEOSGeom' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(1326) : warning C4013:
>>> 'GEOSDifference' undefined; assuming extern returning int
>>> cartography\geometry\_geommodule.c(1326) : warning C4047: '=' :
>>> 'GEOSGeom' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(1347) : warning C4013:
>>> 'GEOSSymDifference' undefined; assuming extern returning int
>>> cartography\geometry\_geommodule.c(1347) : warning C4047: '=' :
>>> 'GEOSGeom' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(1362) : warning C4013:
>>> 'GEOSBoundary' undefined; assuming extern returning int
>>> cartography\geometry\_geommodule.c(1362) : warning C4047: '=' :
>>> 'GEOSGeom' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(1383) : warning C4013:
>>> 'GEOSUnion' undefined; assuming extern returning int
>>> cartography\geometry\_geommodule.c(1383) : warning C4047: '=' :
>>> 'GEOSGeom' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(1398) : warning C4013:
>>> 'GEOSPointOnSurface' undefined; assuming extern returning int
>>> cartography\geometry\_geommodule.c(1398) : warning C4047: '=' :
>>> 'GEOSGeom' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(1413) : warning C4013:
>>> 'GEOSGetCentroid' undefined; assuming extern returning int
>>> cartography\geometry\_geommodule.c(1413) : warning C4047: '=' :
>>> 'GEOSGeom' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(1694) : warning C4013:
>>> 'GEOSGetGeometryN' undefined; assuming extern returning int
>>> cartography\geometry\_geommodule.c(1694) : warning C4047: '=' :
>>> 'GEOSGeom' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(1723) : warning C4013:
>>> 'GEOSGetExteriorRing'undefined; assuming extern returning int
>>> cartography\geometry\_geommodule.c(1723) : warning C4047: '=' :
>>> 'GEOSGeom' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(1785) : warning C4013:
>>> 'GEOSGetInteriorRingN' undefined; assuming extern returning int
>>> cartography\geometry\_geommodule.c(1785) : warning C4047: '=' :
>>> 'GEOSGeom' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(1806) : warning C4013:
>>> 'GEOSGeom_getCoordSeq' undefined; assuming extern returning int
>>> cartography\geometry\_geommodule.c(1806) : warning C4047: '=' :
>>> 'GEOSCoordSeq' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(1835) : warning C4018: '<' :
>>> signed/unsigned mismatch
>>> cartography\geometry\_geommodule.c(1855) : warning C4018: '<' :
>>> signed/unsigned mismatch
>>> cartography\geometry\_geommodule.c(1923) : warning C4047: '=' :
>>> 'GEOSCoordSeq' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(1927) : warning C4047: '=' :
>>> 'GEOSCoordSeq' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(1931) : warning C4047: '=' :
>>> 'GEOSCoordSeq' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(1935) : warning C4047: '=' :
>>> 'GEOSGeom' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(1936) : warning C4047: '=' :
>>> 'GEOSCoordSeq' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(1942) : warning C4047: '=' :
>>> 'GEOSGeom' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(1943) : warning C4047: '=' :
>>> 'GEOSCoordSeq' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(1951) : warning C4047: '=' :
>>> 'GEOSGeom' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(1952) : warning C4047: '=' :
>>> 'GEOSCoordSeq' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(1960) : warning C4047: '=' :
>>> 'GEOSGeom' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(1961) : warning C4047: '=' :
>>> 'GEOSCoordSeq' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(1969) : warning C4047: '=' :
>>> 'GEOSGeom' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(1970) : warning C4047: '=' :
>>> 'GEOSGeom' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(1971) : warning C4047: '=' :
>>> 'GEOSCoordSeq' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(1976) : warning C4047: '=' :
>>> 'GEOSGeom' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(1977) : warning C4047: '=' :
>>> 'GEOSCoordSeq' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(1986) : warning C4047: '=' :
>>> 'GEOSGeom' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(1989) : warning C4047: '=' :
>>> 'GEOSCoordSeq' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(1994) : warning C4047: '=' :
>>> 'GEOSGeom' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(1995) : warning C4047: '=' :
>>> 'GEOSCoordSeq' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(2000) : warning C4047: '=' :
>>> 'GEOSGeom' differs in levels of indirection from 'int'
>>> cartography\geometry\_geommodule.c(2001) : warning C4047: '=' :
>>> 'GEOSCoordSeq' differs in levels of indirection from 'int'
>>>
>>>
>>> The new header file does this in many places which is not valid:
>>>
>>> extern GEOSGeometry* GEOS_DLL GEOSGeomFromWKB_buf(const unsigned
>>> char *wkb, size_t size);
>>>
>>> It needs to be (or something like it):
>>> extern GEOS_DLL GEOSGeometry* GEOSGeomFromWKB_buf(const unsigned
>>> char *wkb, size_t size);
>>>
>>> Input on the signed/unsigned warnings and what's causing them would
>>> be appreciated. This module (PCL) wasn't causing them before the
>>> latest updates to the headers.
>>>
>>> Howard
>>>
>>> _______________________________________________
>>> geos-devel mailing list
>>> geos-devel at geos.refractions.net
>>> http://geos.refractions.net/mailman/listinfo/geos-devel
>>
>> _______________________________________________
>> geos-devel mailing list
>> geos-devel at geos.refractions.net
>> http://geos.refractions.net/mailman/listinfo/geos-devel
>
> _______________________________________________
> geos-devel mailing list
> geos-devel at geos.refractions.net
> http://geos.refractions.net/mailman/listinfo/geos-devel
More information about the geos-devel
mailing list