Opened 18 years ago

Last modified 17 years ago

#1007 closed defect

SWIG Python 1.3.1 gdal interface doesn't compile — at Initial Version

Reported by: dpinte@… Owned by: warmerdam
Priority: high Milestone: 1.4.2
Component: default Version: unspecified
Severity: normal Keywords:
Cc:

Description

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 (0)

Note: See TracTickets for help on using tickets.