Opened 16 years ago
Closed 15 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: | |
Cc: |
Description
Hi Frank,
I have just downloaded v1.5 and had to make changes to swig\python\setup.py 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):
build_ext.finalize_options(self)
self.include_dirs.append(self.numpy_include_dir)
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
try:
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'))
except:
print 'Could not run gdal-config!!!!'
Is this a bug or am I doing something wrong here?
Attachments (1)
Change History (3)
by , 16 years ago
Attachment: | swig_python_setup.diff added |
---|
comment:1 by , 16 years ago
Component: | default → PythonBindings |
---|---|
Owner: | changed from | to
comment:2 by , 15 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
You should be modifying setup.cfg instead of editing the setup.py file. There are (commented out) settings for MSVC there already that can be used.
diff file for setup.py