[GRASS-dev] Re: [GRASS GIS] #308: Compiler error while building
python swig
GRASS GIS
trac at osgeo.org
Fri Sep 12 05:01:37 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 glynn):
Replying to [comment:11 hamish]:
> I checked in some fixes to devbr6 SVN but it still doesn't build.
>
{{{
> python_grass6_wrap.c: In function '_wrap_Cluster_nbands_set':
> python_grass6_wrap.c:48044: error: dereferencing pointer to incomplete
type
}}}
The cluster stuff was moved into a separate library (lib/cluster and
cluster.h). The imagery.i file still contains a definition for "struct
Cluster", but the C++ code is assuming that imagery.h will provide a
definition. The quick fix is to #include cluster.h.
> Auto-generation of gis.i seems to be an important thing, so wrt to
tackling that next:
>
> - gis.i seems to be based on gis.h circa 12/17/04 (r16393)
>
> After removing comments and trailing whitespace, then diff'ing versus
gis.h r16393 the changes between gis.h and gis.i are as follows:
>
{{{
> -extern CELL CELL_NODATA;
> +/*extern CELL CELL_NODATA; Sajith */
}}}
This appears to be unused.
{{{
> - struct _Color_Rule_ *next;
> - struct _Color_Rule_ *prev;
> +/* struct _Color_Rule_ *next;
> + struct _Color_Rule_ *prev; Commented By sajith I am confued
here....*/
}}}
Can SWIG not handle recursive type declarations?
> The duplication of the high,low structs was done by Sajith AFAICT.
Can SWIG not handle multiple fields with the same anonymous structure
type? If not, just add a named declaration for the structure before the
"struct _Color_Rule_" declaration.
> I've no idea why of course, but that's what it is.
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.
Essentially, SWIG aims to support the use of C/C++ header files directly.
Although there is still some "not yet supported" syntax, the amount of it
has decreased significantly since the early versions.
--
Ticket URL: <http://trac.osgeo.org/grass/ticket/308#comment:13>
GRASS GIS <http://grass.osgeo.org>
More information about the grass-dev
mailing list