From: William S F. <ws...@fu...> - 2007-04-07 21:14:03
|
VMiklos wrote: > hi, > > i have the following problem: > > i've a library and i'm using swig to create bindings. at the moment > i've perl/java/python bindings and they work as expected > > today i wanted to add a new one: c#. it seems that i have some problems with it > > based on http://www.swig.org/tutorial.html, i've created the binding, > the .so and the .dll files and i've installed them: > > /usr/lib/mono/pacman-csharp/pacman-csharp.dll and /usr/lib/libpacmancsharp.so.0 > > i've compiled the example .cs file: > > $ mcs /r:/usr/lib/mono/pacman-csharp/pacman-csharp.dll runme.cs > > $ cat runme.cs > using System; > public class runme { > static void Main() { > Console.WriteLine(pacman.pacman_initialize("/")); > } > } > > all fine, but when i try to run the runme.exe, then it fails: > > $ ./runme.exe > > Unhandled Exception: System.TypeInitializationException: An exception > was thrown by the type initializer for pacman ---> > System.TypeInitializationException: An exception was thrown by the > type initializer for pacmanPINVOKE ---> > System.TypeInitializationException: An exception was thrown by the > type initializer for SWIGExceptionHelper ---> > System.DllNotFoundException: pacmancsharp > at (wrapper managed-to-native) > SWIGExceptionHelper:SWIGRegisterExceptionCallbacks_pacman > (pacmanPINVOKE/SWIGExceptionHelper/ExceptionDelegate,pacmanPINVOKE/SWIGExceptionHelper/ExceptionDelegate,pacmanPINVOKE/SWIGExceptionHelper/ExceptionDelegate,pacmanPINVOKE/SWIGExceptionHelper/ExceptionDelegate,pacmanPINVOKE/SWIGExceptionHelper/ExceptionDelegate,pacmanPINVOKE/SWIGExceptionHelper/ExceptionDelegate,pacmanPINVOKE/SWIGExceptionHelper/ExceptionDelegate,pacmanPINVOKE/SWIGExceptionHelper/ExceptionDelegate,pacmanPINVOKE/SWIGExceptionHelper/ExceptionDelegate,pacmanPINVOKE/SWIGExceptionHelper/ExceptionDelegate,pacmanPINVOKE/SWIGExceptionHelper/ExceptionDelegate) > at pacmanPINVOKE+SWIGExceptionHelper..cctor () [0x00000] --- End of > inner exception stack trace --- > > at <0x00000> <unknown method> > at pacmanPINVOKE..cctor () [0x00000] --- End of inner exception > stack trace --- > > at <0x00000> <unknown method> > at pacman..cctor () [0x00000] --- End of inner exception stack trace --- > > at <0x00000> <unknown method> > at runme.Main () [0x00000] > > is this a known problem, or is there any idea what can be the problem? > System.DllNotFoundException - this is the clue. Your dll must be in your Windows path or Unix LD_LIBRARY_PATH. William |