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

GRASS GIS trac at osgeo.org
Wed Feb 17 14:21:59 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                 
Resolution:           |    Keywords:  grass6_wxnviz.i, strcasecmp, fink
  Platform:  MacOSX   |         Cpu:  OSX/Intel                        
----------------------+-----------------------------------------------------
Comment (by glynn):

 Replying to [ticket:949 jkaplan]:

 > 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.
 >
 {{{
 > /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
 }}}

 This looks like a bug in wxWidgets. strcasecmp() isn't an ANSI C function,
 so it detects if it's available and provides its own version if it isn't.
 It appears to be getting the detection wrong.

 > 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>

 <strings.h> isn't portable.

 The <wx/string.h> header includes <strings.h> if it's available and
 required:

 {{{
 #ifdef HAVE_STRCASECMP_IN_STRINGS_H
     #include <strings.h>    // for strcasecmp()
 #endif // HAVE_STRCASECMP_IN_STRINGS_H
 }}}

 For whatever reason, the test appears to be incorrect, i.e. it's not
 including it even though it's required.

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


More information about the grass-dev mailing list