Mapscript .NET, compile
Bart van den Eijnden
bartvde at XS4ALL.NL
Thu May 26 10:40:50 PDT 2005
Hi list,
I finally tried to compile Mapscript .NET and I thought I'd share the
process I went through and ask a few questions. Let me start with the
questions :-) :
1) why won't the generated mapscript_wrap.c file compile out of the box
(see below)?
2) what is the difference between mapscript.dll and mapscript_csharp.dll?
3) using the utilities eg shpdump I do get a few unhandled exceptions. Is
that supposed to be the case?
Shape 1 has 1 part(s)
bounds (362153.9375, 3651581.75) (413756.1875, 3708708)
Unhandled Exception: System.NullReferenceException: Object reference not
set to
an instance of an object.
at ShapeDump.Main(String[] args)
What I did is:
* download SWIG from
http://prdownloads.sourceforge.net/swig/swigwin-1.3.24.zip
* I put swig.exe and a few other files needed in the mapscript/csharp
directory (mainly the contents of the swig lib directory)
* I ran nmake /f makefile.vc but ran into a problem
The mapscript_wrap.c file generated by SWIG would not compile, so I
removed the last bit, saved the file, and made sure it would not be
generated again by commenting out one line in the makefile.vc.
This is the part I had to remove from mapscript_wrap.c
if (msSetup() != MS_SUCCESS)
{
msSetError(MS_MISCERR, "Failed to set up threads and font cache",
"msSetup()");
}
This is the line I commented in the makefile.vc in order not to
re-generate the SWIG C file:
interface: ../mapscript.i
# $(SWIG) -csharp -o mapscript_wrap.c ../mapscript.i
The only problem I had left was that my c sharp compiler (csc.exe) which
is part of the .NET framework was not in my path so I used the following
in my makefile.vc:
CSC = c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\csc.exe
Best regards,
Bart
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
More information about the MapServer-users
mailing list