[Mapserver-users] mapscript.i question

Sean Gillies sgillies at frii.com
Fri Jul 30 18:56:19 EDT 2004


On Jul 30, 2004, at 4:41 PM, Robert Thibadeau wrote:

>
> From the 4.2.1 release the perl mapscript readme says:
>
> If the mapscript_wrap.c file does not exist, copy the mapscript.i file
> into this directory and run 'swig -shadow -perl5 mapscript.i'. If you 
> do
> not have swig, be sure to install the **SWIG Version 1.1 (Build 883)** 
> not
> the
> 1.3.x development release.
>
> Swig 1.1 fails on
>
> %typemap(memberin,warning="451:Setting const char * member may leak
> memory.") const char * {
>   if ($input) {
>      $1 = ($1_type) malloc(strlen($input)+1);
>      strcpy((char*)$1,$input);
>   } else {
>      $1 = 0;
>   }
> }
> and the like with a input syntax error which the second arg in the 
> typemap
> (warning ...) seems to spring.
> However, using the
> SWIG Version 1.3.21
> Copyright (c) 1995-1998
> University of Utah and the Regents of the University of California
> Copyright (c) 1998-2003
> University of Chicago
> Compiled with g++ [i686-pc-linux-gnu]
>
> does not throw the error.
>
> This is kind of a catch 22: using the preferred swig throws an input 
> syntax
> error
> and using the wrong compiles (at least).  What should I believe?  What 
> is
> wrong
> with swig 1.3?
>
> regards, Bob
>

Bob,

The Perl stuff has fallen a bit out of date.  The README is almost
3 years old!

The wrapper code distributed with mapserver 4.2.x is generated using
swig 1.3.21.  Use that version of swig and you'll be fine.

cheers,
Sean


--
Sean Gillies
sgillies at frii dot com
http://users.frii.com/sgillies




More information about the mapserver-users mailing list