[GRASS-dev] [GRASS GIS] #949: strings.h error when compiling recent versions of nviz

GRASS GIS trac at osgeo.org
Wed Feb 17 09:07:08 EST 2010


#949: strings.h error when compiling recent versions of nviz
-----------------------------------------------+----------------------------
 Reporter:  jkaplan                            |       Owner:  grass-dev at lists.osgeo.org
     Type:  defect                             |      Status:  new                      
 Priority:  normal                             |   Milestone:  6.4.0                    
Component:  NVIZ                               |     Version:  svn-develbranch6         
 Keywords:  grass6_wxnviz.i, strcasecmp, fink  |    Platform:  MacOSX                   
      Cpu:  OSX/Intel                          |  
-----------------------------------------------+----------------------------
 Hello GRASS developers,

 When trying to compile recent versions of GRASS (v.6 development branch or
 GRASS 7) I encountered an error during compilation of nviz related to the
 function 'strcasecmp' which seems to be included through several layers of
 the wxgtk libraries.  Please see the command line output below.

 {{{
 admin at Abies:~/Downloads/grass6/grass6_devel/gui/wxpython/nviz > make
 python setup.py build_ext --swig=/sw/bin/swig --swig-opts=-c++ --build-
 lib=OBJ.i386-apple-darwin10.2.0 --build-temp=OBJ.i386-apple-darwin10.2.0
 running build_ext
 building '_grass6_wxnviz' extension
 swigging grass6_wxnviz.i to grass6_wxnviz_wrap.cpp
 /sw/bin/swig -python -c++ -o grass6_wxnviz_wrap.cpp grass6_wxnviz.i
 gcc -fno-strict-aliasing -mno-fused-madd -DNDEBUG -g -fwrapv -O3 -Wall
 -Wstrict-prototypes -DPACKAGE="grasslibs" -D_FILE_OFFSET_BITS=64
 -D_LARGE_FILES -D__WXGTK__
 -I/Users/admin/Downloads/grass6/grass6_devel/dist.i386-apple-
 darwin10.2.0/include
 -I/Library/Frameworks/GDAL.framework/Versions/1.6/Headers
 -I/sw/lib/wx/include/gtk2-unicode-release-2.8 -I/sw/include/wx-2.8
 -I/usr/X11/include -I/usr/X11R6/include -I/sw/include/python2.5 -c
 grass6_wxnviz_wrap.cpp -o OBJ.i386-apple-darwin10.2.0/grass6_wxnviz_wrap.o
 cc1plus: warning: command line option "-Wstrict-prototypes" is valid for
 C/ObjC but not for C++
 In file included from /sw/include/wx-2.8/wx/memory.h:16,
                  from /sw/include/wx-2.8/wx/object.h:20,
                  from /sw/include/wx-2.8/wx/wx.h:16,
                  from nviz.h:23,
                  from grass6_wxnviz_wrap.cpp:2612:
 /sw/include/wx-2.8/wx/string.h: In function 'int Stricmp(const char*,
 const char*)':
 /sw/include/wx-2.8/wx/string.h:141: error: 'strcasecmp' was not declared
 in this scope
 error: command 'gcc' failed with exit status 1
 make: *** [OBJ.i386-apple-darwin10.2.0/_grass6_wxnviz.so] Error 1
 }}}

 ----

 I am not experienced enough of a programmer to know the "right" way to
 solve this problem, but I was able to make a workaround by modifying the
 file grass6_devel/gui/wxpython/nviz/grass6_wxnviz.i to include the
 statement #include <strings.h>

 The first lines of grass6_wxnviz.i in my patched version (which does
 compile)  look like this:

 {{{
 /* File: nviz.i */

 %module grass6_wxnviz
 %{
 #include <strings.h>
 #include "nviz.h"
 #include <grass/gsurf.h>
 #include <grass/gstypes.h>
 #undef check
 %}
 }}}
 etc...

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/949>
GRASS GIS <http://grass.osgeo.org>


More information about the grass-dev mailing list