Compiling mapscript-csharp on Linux

Mike Leahy mgleahy at GOLDEN.NET
Mon Nov 6 15:20:48 PST 2006


Hello again,

It looks like I am having problems with the mapscript_csharp library.

Earlier, I had neglected to run 'make test', and now that I do, I find 
I'm getting an Unhandled Exception (see below).  It seems that it is the 
libmapscript.so that has this problem, since if I use the 
mapscript_csharp.dll in windows with a pre-compiled copy of 
mapscript.dll, it works fine as far as I can tell.  Once I try to do the 
same in Linux with the libmapscript.so that I compiled, it fails with 
the same errors as the make test output.  I'm not sure why I would get a 
System.DllNotFoundException - I tried copying the library to my lib 
folder.  If it try 'ldd libmapscript.so', the output also looks okay.

I might also point out that I had a number of funny error messages about 
incompatible libraries at the end of the compile process, when the 
php_mapscript.so library is created.  These messages look something like 
"/usr/bin/ld: skipping incompatible /usr/lib/lxml2.so when searching for 
-lxml2", and the list is pretty long.  So far, it seems the library 
loads fine in PHP, though I haven't had a chance to test it with an 
actual map yet.  Could the fact that I'm running on an x86_64 version of 
Fedora 6 be a problem?

I hope somebody on the list can give me some insight into this problem.

Mike

============ output from 'make test' in mapscript/csharp ==========


mgleahy at localhost csharp]$ make test
LC_ALL=C mono ./shpdump.exe ../../tests/point.shp

Unhandled Exception: System.TypeInitializationException: An exception 
was thrown by the type initializer for mapscriptPINVOKE ---> 
System.TypeInitializationException: An exception was thrown by the type 
initializer for SWIGExceptionHelper ---> System.DllNotFoundException: 
libmapscript.so
   at (wrapper managed-to-native) 
SWIGExceptionHelper:SWIGRegisterExceptionCallbacks_mapscript 
(mapscriptPINVOKE/SWIGExceptionHelper/ExceptionDelegate,mapscriptPINVOKE/SWIGExceptionHelper/ExceptionDelegate,mapscriptPINVOKE/SWIGExceptionHelper/ExceptionDelegate,mapscriptPINVOKE/SWIGExceptionHelper/ExceptionDelegate,mapscriptPINVOKE/SWIGExceptionHelper/ExceptionDelegate,mapscriptPINVOKE/SWIGExceptionHelper/ExceptionDelegate,mapscriptPINVOKE/SWIGExceptionHelper/ExceptionDelegate,mapscriptPINVOKE/SWIGExceptionHelper/ExceptionDelegate,mapscriptPINVOKE/SWIGExceptionHelper/ExceptionDelegate,mapscriptPINVOKE/SWIGExceptionHelper/ExceptionDelegate)
   at mapscriptPINVOKE+SWIGExceptionHelper..cctor () [0x00000] --- End 
of inner exception stack trace ---

   at <0x00000> <unknown method>
   at mapscriptPINVOKE..cctor () [0x00000] --- End of inner exception 
stack trace ---

   at <0x00000> <unknown method>
   at shapefileObj..ctor (System.String filename, Int32 type) [0x00000]
   at ShapeDump.Main (System.String[] args) [0x00000]
make: *** [test] Error 1




Mike Leahy wrote:
> Hello list,
> 
> I just finished compiling MapServer on FC6, and I was wondering about 
> some errors I had when I compiled the C# mapscript library.  There is a 
> line related to the MySQL support in the csharp Makefile that looks like 
> so:
> 
> MYGIS_INC=  -I/usr/include/mysql -g -pipe -Wp,-D_FORTIFY_SOURCE=2 
> -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 
> -mtune=generic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE 
> -fno-strict-aliasing -fwrapv
> 
> If I leave it as-is, I get the following errors when I attempt to 
> compile the module with make:
> 
> swig error : Unrecognized option -g
> swig error : Unrecognized option -pipe
> swig error : Unrecognized option -Wp,-D_FORTIFY_SOURCE=2
> swig error : Unrecognized option -fexceptions
> swig error : Unrecognized option -fstack-protector
> swig error : Unrecognized option --param=ssp-buffer-size=4
> swig error : Unrecognized option -m64
> swig error : Unrecognized option -mtune=generic
> swig error : Unrecognized option -fno-strict-aliasing
> swig error : Unrecognized option -fwrapv
> Use 'swig -help' for available options.
> make: *** [interface] Error 1
> 
> So...I removed everthing on that line starting with '-g', and it 
> compiled fine.  My question is whether this is something that I'm likely 
> to run into trouble with later on - I don't generally use MySQL, so my 
> guess is no.  If anyone has any insight related to this, I'd be 
> interested to hear it.
> 
> Thanks,
> Mike
> 



More information about the MapServer-users mailing list