Opened 18 years ago
Last modified 16 years ago
#1007 closed defect
SWIG Python 1.3.1 gdal interface doesn't compile — at Version 7
Reported by: | Owned by: | hobu | |
---|---|---|---|
Priority: | high | Milestone: | 1.4.2 |
Component: | default | Version: | unspecified |
Severity: | normal | Keywords: | |
Cc: |
Description (last modified by )
Hi, I'm trying to build Python interface on WindowsXP using Cygwin. Here is the way I did it : ./configure --with-ngpython make The first error was when trying to import gdalwarper.h because includes did not contain the alg directory. Here is the fix (just added alg dir in the include_dirs: line 93 of swig/python/setup.py : include_dirs=[path.join(TOP_DIR,"alg"), path.join(TOP_DIR,"gcore"), path.join(TOP_DIR,"port"), path.join(TOP_DIR,"ogr"), path.join(TOP_DIR,"pymod"), ] # only necessary The next error is the following : make[2]: Entering directory `/cygdrive/c/Downloads/gdal-1.3.1/swig/python' python setup.py build LIBRARY_DIRS: ['../../', './', '/usr/local/lib'] LIBRARIES: ['gdal', 'z', 'stdc++'] INCLUDE_FILES: ['../../gcore/gdal.h', '../../gcore/gdaljp2metadata.h', '../../gcore/gdal_frmts.h', '../../gcore/gdal_pam.h', '../../gcore/gdal_priv.h', '../../gcore/gdal_rat.h', '../../gcore/gdal_version.h', '../../port/cpl_config.h', '../../port/cpl_conv.h', '../../port/cpl_csv.h', '../../port/cpl_error.h', '../../port/cpl_list.h', '../../port/cpl_minixml.h', '../../port/cpl_multiproc.h', '../../port/cpl_odbc.h', '../../port/cpl_port.h', '../../port/cpl_string.h', '../../port/cpl_vsi.h', '../../port/cpl_vsi_private.h', '../../alg/gdalwarper.h', '../../alg/gdal_alg.h', '../../alg/gvgcpfit.h', '../../alg/thinplatespline.h', '../../ogr/ogr_api.h', '../../ogr/ogr_core.h', '../../ogr/ogr_feature.h', '../../ogr/ogr_featurestyle.h', '../../ogr/ogr_geometry.h', '../../ogr/ogr_geos.h', '../../ogr/ogr_p.h', '../../ogr/ogr_spatialref.h', '../../ogr/ogr_srs_api.h', '../../ogr/oledbgis.h', '../../ogr/oledb_sup.h', '../../ogr/sfcdatasource.h', '../../ogr/sfcenumerator.h', '../../ogr/sfclsid.h', '../../ogr/sfcschemarowsets.h', '../../ogr/sfctable.h', '../../ogr/sfiiddef.h', '../../ogr/swq.h', '../../ogr/ogrsf_frmts/ogrsf_frmts.h', '../../ogr/ogrsf_frmts/ogr_attrind.h'] running build running build_py running build_ext building '_gdal' extension c++ -shared -Wl,--enable-auto-image-base build/temp.cygwin-1.5.18-i686-2.4/gdal_wrap.o -L../../ -L./ -L/usr/local/lib -L/usr/lib/python2.4/config -lgdal -lz -lstdc++ -lpython2.4 -o build/lib.cygwin-1.5.18-i686-2.4/_gdal.dll /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: cannot find -lgdal collect2: ld returned 1 exit status error: command 'c++' failed with exit status 1 make[2]: Leaving directory `/cygdrive/c/Downloads/gdal-1.3.1/swig/python' make[1]: Leaving directory `/cygdrive/c/Downloads/gdal-1.3.1/swig' ++' failed with exit status 1 make[2]: *** [build] Error 1 make[1]: *** [build] Error 2 make: *** [swig-target] Error I'm not a linker expert ... how can i solve that ? -lgdal seems to indicate gdal library but it is currently build no ? Didrik
Change History (5)
comment:2 by , 18 years ago
Hi, I've solved the problem. gdal library is build under the .libs directory of the gdal sources. The -lgdal did not work during compilation because it does not found the compiled lib. Changing the path of libraries used for compilation solve the problem (line 73 of swig/python/setup.py) : library_dirs = [TOP_DIR+"/",TOP_DIR+"/.libs/"] With this correction and the line 45 correction (removing PG_LIB and MYSQL_LIB), I can compile and build the GDAL library on a XP system with Cygwin.
comment:4 by , 17 years ago
Howard, Good question. I have to admit I did not test it on the 1.3.2 version. I will try to test it before the New Year ;-) Didrik
comment:7 by , 17 years ago
Description: | modified (diff) |
---|---|
Milestone: | → 1.4.1 |
Owner: | changed from | to
Status: | new → assigned |
Didrik,
Do you happen to know if these issues have been resolved? We have been doing a number of setup.py updates lately for the 1.4.1 release, we might as well clean this one up if it still exists.
Howard
Note:
See TracTickets
for help on using tickets.