Mapscript & Python

Stephen Lime steve.lime at dnr.state.mn.us
Mon Nov 13 10:43:16 EST 2000


I can't comment on the Python build, but can on the msSaveImage confusion.
SWIG works off the interface file AND C headers. If you look at the map.h
file you'll see SWIG related ifdef's all over the place. Basically I'm limiting what
can be wrapped by SWIG. The function msSaveImage is wrapped directly
from the header and needs not be included as part of the object interface in
mapscript.i

Steve

BTW You might try a more recent version of SWIG. 1.1p5 is kinda old.

Stephen Lime
Internet Applications Analyst

Minnesota DNR
500 Lafayette Road
St. Paul, MN 55155
651-297-2937

>>> Nicholas Lo <nicklo at siliconcreation.com> 11/11/00 03:58AM >>>
Hi everyone,


I'm using MapServer 3.3.011 and I'm trying to create the Python
Mapscript wrapper using SWIG 1.1p5. However, it has been unsuccessful.
Here are my steps:

1.
Under mapserver/mapscript
cp mapscript.i python

2.
cd python

3.
swig -shadow -docstring -dhtml -python mapscript.i

4.
gcc mapscript_wrap.c -I/usr/include/python1.5 -shadow -o
mapscriptcmodule.so

After all these steps, I've got
mapscript.py mapscript_wrap.c mapscriptcmodule.so mapscript_wrap.html

When I try to

>>>import mapscript

under IDLE 0.5, I've got

Traceback (innermost last):
  File "<pyshell#0>", line 1, in ?
    import mapscript
  File "/root/NickPy/mapscript.py", line 2, in ?
    import mapscriptc
ImportError: /root/NickPy/mapscriptcmodule.so: undefined symbol:
msSaveImage
>>>

I really dont understand why. I can see 'msSaveImage' inside
mapscript.py & mapscript_wrap.c, however it's not inside mapscript.i. I
wonder if there's any step I'm missing or if there is any hints in
creating the Python Mapscript wrapper.

Please kindly help :)


-- Nick


PS:
System configuration -
SuSE Linux 6.4
Python 1.5.2
MapServer 3.3.011




More information about the mapserver-users mailing list