[GRASS-dev] Re: [GRASS GIS] #308: Compiler error while building
python swig
GRASS GIS
trac at osgeo.org
Sun Sep 14 03:26:13 EDT 2008
#308: Compiler error while building python swig
----------------------------------+-----------------------------------------
Reporter: cgsbob | Owner: grass-dev at lists.osgeo.org
Type: defect | Status: new
Priority: major | Milestone: 6.4.0
Component: SWIG (all bindings) | Version: svn-develbranch6
Resolution: | Keywords: python swig
Platform: Unspecified | Cpu: Unspecified
----------------------------------+-----------------------------------------
Comment (by hamish):
cluster lib stuff removed from imagery.i in SVN, SWIG/Python now builds
again.
TODO/redo: further automated grass/*.h -> *.i
Glynn:
> First, I suggest replacing the contents of gis.i with "%include
<grass/gis.h>"
> and seeing if that actually causes any errors. Ditto for all of the
other
> interfaces/*.i files.
It doesn't know where to find $(MODULE_TOPDIR)/include/
{{{ interfaces/gis.i:1: Error: Unable to find 'grass/gis.h' }}}
If I get around that by hardcoding the path it shows that _Color_Rule_ is
still a problem:
{{{
struct _Color_Rule_
{
struct
{
DCELL value;
unsigned char red;
unsigned char grn;
unsigned char blu;
} low, high;
struct _Color_Rule_ *next;
struct _Color_Rule_ *prev;
};
}}}
{{{
$ make
...
/usr/bin/swig -python -shadow python_grass6.i
renames.i:2: Warning(301): class keyword used, but not in C++ mode.
/usr/src/grass/svn/grass64/include/gis.h:289: Error: Syntax error in
input(3).
/usr/src/grass/svn/grass64/include/gis.h:39: Warning(451): Setting a const
char * variable may leak memory.
/usr/src/grass/svn/grass64/include/gis.h:574: Warning(451): Setting a
const char * variable may leak memory.
/usr/src/grass/svn/grass64/include/gis.h:578: Warning(451): Setting a
const char * variable may leak memory.
...
}}}
Recursive use of a struct is not the problem, it's the "low, high"
multiple defn which is creating the syntax error. If I clone that into two
separate struct defns it builds ok.
Hamish
--
Ticket URL: <http://trac.osgeo.org/grass/ticket/308#comment:14>
GRASS GIS <http://grass.osgeo.org>
More information about the grass-dev
mailing list