Opened 11 years ago

Closed 10 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)

swig_python_setup.diff (877 bytes) - added by timaranz 11 years ago.
diff file for setup.py

Download all attachments as: .zip

Change History (3)

Changed 11 years ago by timaranz

Attachment: swig_python_setup.diff added

diff file for setup.py

comment:1 Changed 11 years ago by timaranz

Component: defaultPythonBindings
Owner: changed from warmerdam to hobu

comment:2 Changed 10 years ago by hobu

Resolution: invalid
Status: newclosed

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.

Note: See TracTickets for help on using tickets.