Some Notes on Compiling Applications Against GEOS 3.0.0rc4

Submitted by dylan on Tue, 2007-12-11 19:52.

I recently upgraded to GEOS 3.0.0rc4 in order to take advantage of its more robust handling of invalid geometries (damn shapefiles!). However, there are two mini-bugs in this release which need to be sorted out when compiling against it (or at least for the two application I was interested in: QGIS and StarSpan). Note that the first issue presented here has been resolved in GEOS 3.0.0rc5.

  1. Several of the GEOS source files contain little notes about "warning *** FIXME: to be removed, temporarly set to allow a quick successful build" which cause compiler warning messages. While this is not a big problem, it makes some applications which use the compiler flags -Wall and -Werror barf. This is the default mode for the latest versions of QGIS, and therefore the "PEDANTIC" flag in its configuration should be set to OFF.
  2. A recent patch to 'source/inlines.cpp' (included in GEOS 3.0.0rc4) meant to deal with compiler problems on Windows causes problems for real operating systems. As documented here suggests changing line 30 of 'source/inlines.cpp' from:

    #if defined(__MINGW32__) && !defined(DLL_EXPORT)
    
    to
    
    #if !defined(__MINGW32__) || defined(__MINGW32__) && !defined(DLL_EXPORT)
    

     
    After doing this, re-compile / re-install GEOS 3.0.0rc4 and applications built against it should not have any problems with functions not being defined. This has been submitted as ticket #166 on the GEOS Trac page.