[mapserver-users] PythonMapscript Installation under Windows

Schuster Grit.Schuster at uni-vechta.de
Fri Oct 11 04:36:16 PDT 2002


Hi everybody,


I tried to compile pythonMapscript (MS 3.6.2) under Windows 2000 with Python 

2.1.3, SWIG 1.3.15 and MSVC7 compiler, using Norman Vine's setup.py script.
I tried to modified it to reflect windows requirements concerning directories
and 

libraries. 
When I run the setup, there is a problem when building the MapScriptc
extension.
I get the following error (translated from german):

mapscript_wrap.obj: error LNK2001: unresolved external Symbol initMapscriptc
build\temp.win32-2.1\Release\MapScriptc.lib: fatal error LNK 1120: 1 unresolved


external references
LINK : fatal error LNK1141: build export file error
error: command 'link.exe failed with exit status 1141

Has anybody had simliar problems or gathered experience building the mapscript 

extension for python under windows? I attach below the modified setup script in


case someone wants to take a look at it.

TIA, Grit


------------------------
setup.py:

#! /usr/bin/env python
# Distutils setup for UMN Mapserver mapscript v.3.5
# Norman Vine 11/10/2001

# On cygwin this will require my Distutils mods available @
# http://www.vso.cape.com/~nhv/files/python/mydistutils.txt
# Should work as is on 'Unix' like systems
# needs testing on Windows compilers other then Cygwin

# To Install
# build mapserver
# Copy this file to $MAPSERVER_SRC / mapscript / python
# invoke as ./setup.py install

# should work on any python version with Distutils

__revision__ = "$Id: mapscript_setup.py,v 1.5 2001/11/10 15:22:02 nhv Exp $"

from distutils.core import setup, Extension
from distutils.spawn import spawn
from distutils.dir_util import mkpath
from distutils.file_util import copy_file
from distutils.sysconfig import parse_makefile

import os,sys
from os import path

noisy=1
swig_cmd = ["d:\ms\swig-1.3.15\swig",
            "-python",
            "-shadow",
            "-module",
            "MapScript",
            "-o",
            "./mapscript_wrap.c",
            "../mapscript.i" ]

try:                        
    spawn(swig_cmd, verbose=noisy)
except:
    print "\nSwig Error"
    raise sys.exit()

# make package directory and package __init__ script
mkpath("mapscript")
init_file=open(path.join("mapscript","__init__.py"),"w")
init_file.write("from MapScript import *\n")
init_file.close()

copy_file("MapScript.py", path.join("mapscript","MapScript.py"), verbose=noisy)

# change to reflect the gd version you are using
gd_dir="gd-1.8.4"
ms_dir=path.join("D:\ms\mapserver-3.6.2")
local_dir="D:\ms"
freetype="freetype\lib"
png_dir="lpng124"
proj="proj\src"
tiff="tiff-v3.5.7\libtiff"
oracle_inc="d:\oracle\ora81\oci\include"
oracle_lib="d:\oracle\ora81\oci\lib\msvc"
regex_dir="regex-0.12"

setup (# Distribution meta-data
       name = "pyMapScript",
       version = "3.6",
       description = "pre release",
       author = "Steve Lime",
       author_email = "steve.lime at dnr.state.mn.us",
       url = "http://mapserver.gis.umn.edu/",

       # Description of the modules and packages in the distribution
       packages = ['mapscript'],
       ext_modules = 
           [Extension('MapScriptc', ['mapscript_wrap.c'],
                      

define_macros=[('TIFF_STATIC',),('JPEG_STATIC',),('ZLIB_STATIC',),
                          

('IGNORE_MISSING_DATA',),('USE_EPPL',),('USE_PROJ',),('USE_PROJ_API_H',),
                          

('USE_WMS',),('USE_WMS_LYR',),('USE_TIFF',),('USE_JPEG',),('USE_GD_PNG',),('USE_
G

D_GIF',),('USE_GD_JPEG',),
                         
('USE_GD_WBMP',),('USE_GDAL',),('USE_ORACLESPATIAL',)],
                      include_dirs=[ms_dir,
                          path.join(local_dir,gd_dir),
                          path.join(local_dir,freetype),
                          path.join(local_dir,tiff),
                          path.join(local_dir,oracle_inc),                     
  

            
                          path.join(local_dir,proj),
                          path.join(local_dir,regex_dir)],
                      library_dirs=[ms_dir,
                          path.join(local_dir,gd_dir),
                          path.join(local_dir,freetype),
                          path.join(local_dir,tiff),
                          path.join(local_dir,oracle_lib),                     
  

            
                          path.join(local_dir,proj),
                          path.join(local_dir,png_dir)],
                      extra_objects=[path.join(ms_dir,'mapserver.lib'),
                          

path.join(local_dir,'gdal\ogr\ogrsf_frmts\ogrsf_frmts.lib'),
                          path.join(local_dir,'gdal\gdal.lib'),
                          path.join(local_dir,'gdal\ogr\ogr.lib'),
                          path.join(local_dir,'gdal\port\cpl.lib')],
#                      

libraries=['gd','gdft','freetype','ttf','proj','pq','png','z'],),
                     
libraries=['gd','freetype','libpng','proj','zlib','oci'],), 

                         
           ]
      )

-- 



More information about the MapServer-users mailing list