Menu

#24 Can't run in linux, SDL.dll not found exception !!

open
nobody
5
2013-08-19
2011-09-18
No

Hello,
Currently i try to port "My Nes " c# emulator to sdl to run in linux, I uses sdl.net and everything is ok, I built the project for linux using mono, then when I try to run in UBUNTU LINUX, it throws exception:
NotHandledException : SDL.dll not found ...
I installed sdl in linux, updated mono and everything and the same problem still. any help ?

Discussion

  • Anonymous

    Anonymous - 2011-09-18

    I use SDL under Ubuntu without issues. You just need to make sure that you have the right files, and that they are in the right place. Can you describe what you have done so far? Did you put the SDL.dll file in the same directory as your exe? Did you install the low-level sdl libraries from the Ubuntu package system?

     

    Last edit: Anonymous 2013-11-21
  • Anonymous

    Anonymous - 2011-09-18

    I put the file SDL.dll in the same directory, also I put all associated files for sdl.net (SDL_gfx.dll, SDL_image.dll ...) and the same problem still. the exception as termenal :

    Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for SdlDotNet.Graphics.Video ---> System.DllNotFoundException: SDL.dll
    at (wrapper managed-to-native) Tao.Sdl.Sdl:SDL_WasInit (int)
    at SdlDotNet.Graphics.Video.Initialize () [0x00000] in <filename unknown>:0
    at SdlDotNet.Graphics.Video..cctor () [0x00000] in <filename unknown>:0
    --- End of inner exception stack trace ---
    at MyNesSDL.videoSDL..ctor (TVFORMAT tv, Boolean fullScreen, Boolean resizable, Int32 w, Int32 h, System.String romName) [0x00000] in <filename unknown>:0
    at MyNesSDL.MyNesSDL.LoadCart () [0x00000] in <filename unknown>:0
    at MyNesSDL.MyNesSDL.Main (System.String[] Args) [0x00000] in <filename unknown>:0

     
  • Anonymous

    Anonymous - 2011-09-18

    One thing you can do is look at the log to see where it is looking. Try setting the MONO_LOG_LEVEL, this this:

    MONO_LOG_LEVEL=debug mono file.exe

     
  • Anonymous

    Anonymous - 2011-09-18

    Before the log, I installed sdl only not sdl.net on linux, do I need and how to install sdl.net in linux ? If this is the problem, sorry for bothered you :)

     
  • Anonymous

    Anonymous - 2011-09-18

    Perhaps:

    sudo apt-get install libsdl1.2debian-all

     
  • Anonymous

    Anonymous - 2011-09-18

    Installed and my emu worked, thanks :)
    But still a small problem, I emulate sound and uses AudioStream for sound but when run thwe emulator in linux it hangs and need to restart to exit ...
    Is something missing or it just my code ?

    My Code

        AudioStream stream;
        AudioCallback callback;
        NesApu apu;
    
        public soundSDL\(NesApu Apu, bool On\)
        \{
            apu = Apu;
            if \(On\)
            \{
            callback = new AudioCallback\(Unsigned16BigCallback\);
            stream = new AudioStream\(44100, AudioFormat.Unsigned16Big,
                SoundChannel.Mono,0,callback, "My Nes Sound"\);
            stream.Paused = false;
            \}
        \}
        void Unsigned16BigCallback\(IntPtr userData, IntPtr stream, int len\)
    

    {
    len /= 2;
    int bufPos = 0;
    short[] buff = new short[len];
    while (bufPos < len)
    {
    buff[bufPos] = (short)apu.PullSample();
    bufPos++;
    }

    Marshal.Copy(buff, 0, stream, len);

    len = 0;
    }

     
  • MN#

    MN# - 2013-08-19

    It's not a BUG, because you are run ``Tao for windows'' on linux

    you need ``Tao for Mono'' to run on linux

    you can download from http://www.mono-project.com/Tao to replace your dlls

     

    Last edit: MN# 2013-08-20

Log in to post a comment.