I had installed GDAL from a synaptic package, not source. I removed the synaptic version and installed 1.9 from source and everything works now.
Thanks, David -----Original Message----- From: Even Rouault [mailto:even.roua...@mines-paris.org] Sent: Wednesday, April 25, 2012 1:39 PM To: gdal-dev@lists.osgeo.org Cc: David Hodo Subject: Re: [gdal-dev] Python 3 on Ubuntu 11.10 Le mercredi 25 avril 2012 20:32:28, David Hodo a écrit : > I'm trying to install GDAL for Python 3 on Ubuntu 11.10 and having > some problems. I installed GDAL 1.7.0 and the header files from with > Synaptic. > I initially tried installing the Python bindings with 'sudo > easy_install GDAL'. This worked for me, but the installed version > does not work with Python 3. > > I then tried downloading the latest version from the website and > installing with 'python3.2 setup.py build', but the command fails with the > error: > > running build > running build_py > running build_ext > building 'osgeo._gdal' extension > gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC > -I../../port -I../../gcore -I../../alg -I../../ogr/ > -I/usr/include/gdal/ -I/usr/include/python3.2mu -I. -I/usr/include -c > extensions/gdal_wrap.cpp -o > build/temp.linux-x86_64-3.2/extensions/gdal_wrap.o > cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid > for Ada/C/ObjC but not for C++ [enabled by default] > extensions/gdal_wrap.cpp: In function ‘void > SWIG_Python_SetModule(swig_module_info*)’: > extensions/gdal_wrap.cpp:2535:22: warning: unused variable > ‘swig_empty_runtime_method_table’ [-Wunused-variable] > extensions/gdal_wrap.cpp: At global scope: > extensions/gdal_wrap.cpp:2999:67: error: ‘VSILFILE’ has not been > declared > extensions/gdal_wrap.cpp: In function ‘int wrapper_VSIFReadL(void**, > int, int, int*)’: > extensions/gdal_wrap.cpp:3018:72: error: cannot convert ‘int*’ to > ‘FILE* {aka _IO_FILE*}’ for argument ‘4’ to ‘size_t VSIFReadL(void*, > size_t, size_t, FILE*)’ > extensions/gdal_wrap.cpp: In function ‘int PyProgressProxy(double, > const char*, void*)’: > extensions/gdal_wrap.cpp:3236:2: warning: the address of ‘_Py_NoneStruct’ > will never be NULL [-Waddress] > extensions/gdal_wrap.cpp: In function ‘int wrapper_VSIStatL(const > char*, StatBuf*, int)’: > extensions/gdal_wrap.cpp:3457:52: error: ‘VSIStatExL’ was not declared > in this scope > extensions/gdal_wrap.cpp: At global scope: > extensions/gdal_wrap.cpp:3465:67: error: ‘VSILFILE’ has not been > declared > extensions/gdal_wrap.cpp: In function ‘int wrapper_VSIFWriteL(int, > char*, int, int, int*)’: > extensions/gdal_wrap.cpp:3472:42: error: cannot convert ‘int*’ to > ‘FILE* {aka _IO_FILE*}’ for argument ‘4’ to ‘size_t VSIFWriteL(const > void*, size_t, size_t, FILE*)’ > extensions/gdal_wrap.cpp: At global scope: > extensions/gdal_wrap.cpp:3801:5: error: ‘GDALAsyncReaderH’ does not > name a type > extensions/gdal_wrap.cpp:3807:8: error: ‘GDALAsyncReaderH’ does not > name a type > extensions/gdal_wrap.cpp: In function ‘void > DeleteAsyncReaderWrapper(GDALAsyncReaderWrapperH)’: > extensions/gdal_wrap.cpp:3826:20: error: ‘struct GDALAsyncReaderWrapper’ > has no member named ‘hAsyncReader’ > .... > > There are another 10 or 15 errors mostly related to VSILFILE not being > declared. > > Any suggestions on how to get GDAL working for Python3? Did you make a full build of GDAL before trying to build the python bindings ? And I also somehow suspect you have GDAL headers from an older version somewhere in your include path, likely in /usr/include or /usr/local/include > > Thanks, > > David _______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev