Need help with compiling mapscript for use with Tcl.

Yeewen Sat yeewen at petromap.com
Wed Nov 22 14:16:35 EST 2000


Thanks for all the help...I was able to compile mapscript.so for Tcl.
However, when I try to load it in tclsh, I get an error:

$ tclsh
% load ./mapscript.so
_40228d40_errorObj_p

Can anyone explain this?

If I build mapscript, and statically link with tcl, I was able to execute it
with no error. I added some simple test functions in mapscript.i, and they
execute fine.

Either case, I have no clue on how to use the exported functions. Does
anyone have any Tcl examples on how to load a mapfile? I just need some
guidance to get me started.

Here's my makefile if anyone is interested:

# Tcl Mapscript makefile
# This lives in new directory $(MAP_HOME)/mapscript/tcl
# I copied from Norman Vine  -- nhv at cape.com -- March 21 2000 (Python
makefile), and modified
# to compile Tcl Mapscript

MAP_HOME =../..

LOCAL = /usr/local


INC = -I$(LOCAL)/include \
	-I$(MAP_HOME) \
	-I$(MAP_HOME)/gd-1.2 \
	-I$(MAP_HOME)/gdft \
	-I$(MAP_HOME)/../freetype-1.3.1/lib

LIBS = -L$(MAP_HOME) -lmap \
	-L$(MAP_HOME)/gd-1.2 -lgd \
	-L$(MAP_HOME)/gdft -lgdft \
	-L$(MAP_HOME)/../freetype-1.3.1/lib/.libs -lttf -ltiff -ljpeg

mapscript.so: mapscript_wrap.o
	gcc -shared mapscript_wrap.o $(LIBS) -o mapscript.so

mapscript_wrap.o: mapscript_wrap.c
	gcc -fpic -c -o mapscript_wrap.o mapscript_wrap.c

# static linking with Tcl
mapscriptsh: mapscript_wrap.c
	gcc mapscript_wrap.c $(INC) $(LIBS) -ltcl -lm -o mapscriptsh






-----Original Message-----
From: owner-mapserver-users at lists.gis.umn.edu
[mailto:owner-mapserver-users at lists.gis.umn.edu]On Behalf Of Stephen
Lime
Sent: November 21, 2000 1:13 PM
To: mapserver-users at lists.gis.umn.edu; yeewen at petromap.com
Subject: Re: Need help with compiling mapscript for use with Tcl.


Warnings are fine. They are related to non-pointer arrays in the various
MapServer
structures. Since they're not pointers SWIG doesn't know what to do with
them.
Doesn't matter since you'd never alter them any way.

Steve

Stephen Lime
Internet Applications Analyst

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

>>> "Yeewen Sat" <yeewen at petromap.com> 11/20/00 04:48PM >>>
I "swiged" mapscript.i to create c wrappers for tcl.

$ swig -tcl mapscript.i
Making wrappers for Tcl
../../map.h : Line 362. Warning. Array member will be read-only.
../../maperror.h : Line 35. Warning. Array member will be read-only.
../../maperror.h : Line 36. Warning. Array member will be read-only.
../../mapshape.h : Line 72. Warning. Array member will be read-only.


Are the above warnings critical?

Also, before I go further, does anyone have a Makefile that will compile
mapscript for use with Tcl?

Thanks,
Yee Wen




More information about the mapserver-users mailing list