[GRASS-user] grass6.4 develbrunch revision 32726: undefined
reference to `G_no_gisinit'
Nikos Alexandris
nikos.alexandris at felis.uni-freiburg.de
Thu Aug 14 08:18:39 EDT 2008
On Thu, 2008-08-14 at 05:37 +0100, Glynn Clements wrote:
> G. Allegri wrote:
>
> > I understand that everything that needs GRASS has to be recompiled if
> > this version changes so much to change its interface (QGis-GRASS
> > plugin, GRASS-GDAL plugin, etc.). But I would like to know why the new
> > develbrunch_6 revision needs the GDAL itself to be recompiled. I can
> > understand it if GRASS would need a newer version of GDAL... is this
> > the case?
>
> You only need to re-compile GDAL itself if GDAL was built with GRASS
> support (--with-grass).
>
> In your original message, you wrote:
>
> > Even switching to develbrunch I receive the same error:
> > usr/local/lib/libgdal.so: undefined reference to `G_no_gisinit'
>
> This indicates that your GDAL library was indeed built --with-grass. I
> suggest building it without that option, and using the GDAL-GRASS
> plugin instead.
>
> If you build GDAL -with-grass, you will need to re-compile GDAL every
> time that GRASS is updated from now on. The problem arises from
> r32695, which makes G_gisinit() check that libgis was built with the
> same version of gis.h as the caller.
>
> The change adds G_gisinit() and G_no_gisinit() macros:
>
> #define GIS_H_VERSION "$Revision: 32726 $"
>
> #define G_gisinit(pgm) G__gisinit(GIS_H_VERSION, (pgm))
> #define G_no_gisinit() G__no_gisinit(GIS_H_VERSION)
>
> The value of GIS_H_VERSION is automatically updated to the SVN
> revision whenever gis.h is updated.
>
> The change also renames the functions to G__gisinit() and
> G__no_gisinit() (which is why you get the "undefined reference" error
> when using an old GDAL with a new libgis), and adds version checks:
>
> int G__gisinit(const char *version, const char *pgm)
> {
> ...
> if (strcmp(version, GIS_H_VERSION) != 0)
> G_fatal_error(_("Incompatible library version for module"));
>
> Any code which uses G_gisinit() or G_no_gisinit() passes the version
> of gis.h with which it was compiled to the library functions, which
> check that the same version of gis.h was used to compile the library.
>
> The rationale is to avoid having to track down subtle errors caused by
> version incompatibilities between libgis and any code which uses it.
> Now, if there is an incompatibility, you get a very unsubtle error
> telling you that there's an incompatibility.
Funny! Today I recompiled all osgeo packages on my Ubuntu-box (install
proj4, install geos, compile gdal_stable without GRASS support, compile
GRASS6.4.svn, compile gdal-grass-plugin, compile qgis_0_11_0). I
carefully linked properly to the "local" installed libraries while
configuring QGIS with ccmake.
Now, while I run QGIS from within GRASS and use GRASS tools without
problems, I can't even load the GRASS-plugin if I run QGIS outside of
the GRASS-shell.
The error message is:
qgis: symbol lookup error: /usr/local/lib/libqgisgrass.so.1.0: undefined
symbol: G__no_gisinit
Greetings, Nikos
More information about the grass-user
mailing list