[GRASS-dev] swig python compilation error in utils_wrap.c

Glynn Clements glynn at gclements.plus.com
Fri Feb 26 15:58:33 EST 2010


Markus Neteler wrote:

> OBJ.x86_64-mandriva-linux-gnu/utils_wrap.o: In function `SWIG_Python_ErrorType':
> /root/rpmbuild/BUILD/grass-6.4.0RC6pre/swig/python/utils_wrap.c:919: undefined reference to `PyExc_RuntimeError'
> /root/rpmbuild/BUILD/grass-6.4.0RC6pre/swig/python/utils_wrap.c:892: undefined reference to `PyExc_RuntimeError'
> /root/rpmbuild/BUILD/grass-6.4.0RC6pre/swig/python/utils_wrap.c:889: undefined reference to `PyExc_IOError'
> ...
> 
> Any ideas? Is a change in swig/include/python/utils.i needed?

Those variables don't appear in the .i files; they only appear in the
code generated by SWIG. However, they do end up in all of the *_wrap.c
files.

As you're getting an error at link time, rather than compile time, I'd
suspect a library mismatch. I note that the only -L switches are those
which refer to dist.<arch>.

I also note that there is no utils_LIBS variable in
swig/python/Makefile (as it doesn't depend upon any GRASS libraries). 
As everything except utils and date[1] has $(GISLIB) as a dependency
(directly or indirectly), I suspect that it may be fixed by defining
utils_LIBS as either some subset of $(XDRLIB) $(SOCKLIB) $(INTLLIB) or
as $(GISLIB).

[1] However, if the date module compiles, that undermines this theory.

Beyond that, I can only suggest comparing the successful linking
commands for the other modules against the failed command for the
utils module.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list