Opened 12 years ago

Closed 11 years ago

#2143 closed defect (invalid)

python swig bindings don't build on XP with msvc

Reported by: timaranz Owned by: hobu
Priority: normal Milestone:
Component: PythonBindings Version: unspecified
Severity: normal Keywords:


Hi Frank,

I have just downloaded v1.5 and had to make changes to swig\python\ to get it to build on Windows XP with msvc 6. It wasn't finding some header and library files. My modifications to gdal_ext.finalize_options are indicated with a '+' at the start of the line.

def finalize_options(self):



if self.get_compiler() == 'msvc':

+ base = os.path.abspath(r'..\..') + self.include_dirs.append(os.path.join(base,'port')) + self.include_dirs.append(os.path.join(base,'gcore')) + self.include_dirs.append(os.path.join(base,'alg')) + self.include_dirs.append(os.path.join(base,'ogr')) + + self.library_dirs.append(base) # for gdal.lib + # this is for odbc support + self.libraries.extend(['odbc32', 'odbccp32', 'user32'])

return True


self.gdaldir = self.get_gdal_config('prefix') self.library_dirs.append(os.path.join(self.gdaldir,'lib')) self.include_dirs.append(os.path.join(self.gdaldir,'include'))


print 'Could not run gdal-config!!!!'

Is this a bug or am I doing something wrong here?

Attachments (1)

swig_python_setup.diff (877 bytes) - added by timaranz 12 years ago.
diff file for

Download all attachments as: .zip

Change History (3)

Changed 12 years ago by timaranz

Attachment: swig_python_setup.diff added

diff file for

comment:1 Changed 12 years ago by timaranz

Component: defaultPythonBindings
Owner: changed from warmerdam to hobu

comment:2 Changed 11 years ago by hobu

Resolution: invalid
Status: newclosed

You should be modifying setup.cfg instead of editing the file. There are (commented out) settings for MSVC there already that can be used.

Note: See TracTickets for help on using tickets.