[gdal-dev] Gdal 1.7.1 and Python3.1

Even Rouault even.rouault at mines-paris.org
Sun Feb 21 18:18:39 EST 2010


Hum, I think you have regenerated swig/python/extensions/gdal_wrap.cpp with 
your own swig version (which is probably too old), as the official version of 
gdal_wrap.cpp in 1.7.1 has lines that don't match with your error message. 
Try restoring the official files in  swig/python/extensions and  
swig/python/osgeo and redo 'sudo /usr/bin/python3.1 setup.py install' again 
(or upgrade your swig version to 1.3.39).

Le Sunday 21 February 2010 23:48:47 Thomas Maschler, vous avez écrit :
> Sounds logical, I already had a weired feeling copying the files just like
> this.
>
> OK, I tried your advice, but I got a long list of errors. Doing the same
> with 2.6 works fine.
>
> $ sudo /usr/bin/python3.1 setup.py install
>
> running install
> running build
> running build_py
> running build_ext
> building 'osgeo._gdal' extension
> gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O2 -Wall -Wstrict-prototypes
> -fPIC -I../../port -I../../gcore -I../../alg -I../../ogr/
> -I/usr/include/python3.1 -I. -I/home/thomas/gdal-1.7.1/include -c
> extensions/gdal_wrap.cpp -o
> build/temp.linux-i686-3.1/extensions/gdal_wrap.o cc1plus: warning: command
> line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
> extensions/gdal_wrap.cpp: In function ‘void SWIG_Python_AddErrorMsg(const
> char*)’: extensions/gdal_wrap.cpp:883: error: ‘PyString_AsString’ was not
> declared in this scope extensions/gdal_wrap.cpp: In function
> ‘PySwigClientData* PySwigClientData_New(PyObject*)’:
> extensions/gdal_wrap.cpp:1274: error: ‘PyClass_Check’ was not declared in
> this scope extensions/gdal_wrap.cpp: In function ‘PyObject*
> PySwigObject_format(const char*, PySwigObject*)’:
> extensions/gdal_wrap.cpp:1347: error: ‘PyString_FromString’ was not
> declared in this scope extensions/gdal_wrap.cpp:1349: error:
> ‘PyString_Format’ was not declared in this scope extensions/gdal_wrap.cpp:
> In function ‘PyObject* PySwigObject_repr(PySwigObject*)’:
> extensions/gdal_wrap.cpp:1379: error: ‘PyString_AsString’ was not declared
> in this scope extensions/gdal_wrap.cpp:1379: error: ‘PyString_FromFormat’
> was not declared in this scope extensions/gdal_wrap.cpp:1387: error:
> ‘PyString_ConcatAndDel’ was not declared in this scope
> extensions/gdal_wrap.cpp: In function ‘int
> PySwigObject_print(PySwigObject*, FILE*, int)’:
> extensions/gdal_wrap.cpp:1401: error: ‘PyString_AsString’ was not declared
> in this scope extensions/gdal_wrap.cpp: In function ‘PyObject*
> PySwigObject_str(PySwigObject*)’: extensions/gdal_wrap.cpp:1414: error:
> ‘PyString_FromString’ was not declared in this scope
> extensions/gdal_wrap.cpp: In function ‘PyTypeObject* _PySwigObject_type()’:
> extensions/gdal_wrap.cpp:1623: error: ‘coercion’ was not declared in this
> scope extensions/gdal_wrap.cpp:1623: error: expected ‘}’ before numeric
> constant extensions/gdal_wrap.cpp:1623: error: too many initializers for
> ‘PyNumberMethods’ extensions/gdal_wrap.cpp:1623: error: invalid conversion
> from ‘PyObject* (*)(PyObject*, PyObject*)’ to ‘PyObject* (*)(PyObject*,
> PyObject*, PyObject*)’ extensions/gdal_wrap.cpp:1623: error: invalid
> conversion from ‘PyObject* (*)(PyObject*, PyObject*, PyObject*)’ to
> ‘PyObject* (*)(PyObject*)’ extensions/gdal_wrap.cpp:1623: error: invalid
> conversion from ‘PyObject* (*)(PyObject*)’ to ‘int (*)(PyObject*)’
> extensions/gdal_wrap.cpp:1623: error: invalid conversion from ‘int
> (*)(PyObject*)’ to ‘PyObject* (*)(PyObject*)’
> extensions/gdal_wrap.cpp:1623: error: expected ‘,’ or ‘;’ before numeric
> constant extensions/gdal_wrap.cpp:1603: warning: unused variable
> ‘swigobject_doc’ extensions/gdal_wrap.cpp:1605: warning: unused variable
> ‘PySwigObject_as_number’ extensions/gdal_wrap.cpp:1636: warning: no return
> statement in function returning non-void extensions/gdal_wrap.cpp: At
> global scope:
> extensions/gdal_wrap.cpp:1640: error: expected unqualified-id before ‘if’
> In file included from /usr/include/c++/4.4/stdexcept:38,
>                  from extensions/gdal_wrap.cpp:2557:
> /usr/include/c++/4.4/exception:35: error: expected ‘}’ before end of line
> /usr/include/c++/4.4/exception:35: error: expected declaration before end
> of line error: command 'gcc' failed with exit status 1
>
>
>
>
>
> $ sudo /usr/bin/python setup.py install
> running install
> running build
> running build_py
> running build_ext
> running install_lib
> running install_egg_info
> Writing /usr/local/lib/python2.6/dist-packages/GDAL-1.7.1.egg-info




More information about the gdal-dev mailing list