2014-12-31 2 views
0

Monogame에서 Visual Studio로 빌드 된 프로젝트를 실행하려고합니다. 그것은 성공적으로 빌드,하지만 난 그것을 실행할 때 다음과 같은 오류 메시지가 얻을 :Monogame의 오류 메시지 : 처리되지 않은 예외 : System.DllNotFoundException : SDL2.dll

은 Game1.cs :

using System; 
using System.Collections.Generic; 
using System.Linq; 
using Microsoft.Xna.Framework; 
using Microsoft.Xna.Framework.Audio; 
using Microsoft.Xna.Framework.Content; 
using Microsoft.Xna.Framework.GamerServices; 
using Microsoft.Xna.Framework.Graphics; 
using Microsoft.Xna.Framework.Input; 
using Microsoft.Xna.Framework.Media; 

namespace MovingTeddyBears 
{ 
    /// <summary> 
    /// This is the main type for your game 
    /// </summary> 
    public class Game1 : Microsoft.Xna.Framework.Game 
    { 
     GraphicsDeviceManager graphics; 
     SpriteBatch spriteBatch; 

     const int WINDOW_WIDTH = 800; 
     const int WINDOW_HEIGHT = 600; 

     // teddy bears 
     TeddyBear bear0; 
     TeddyBear bear1; 
     TeddyBear bear2; 

     public Game1() 
     { 
      graphics = new GraphicsDeviceManager(this); 
      Content.RootDirectory = "Content"; 

      // set resolution to 800 by 600 
      graphics.PreferredBackBufferWidth = WINDOW_WIDTH; 
      graphics.PreferredBackBufferHeight = WINDOW_HEIGHT; 
     } 

     /// <summary> 
     /// Allows the game to perform any initialization it needs to before starting to run. 
     /// This is where it can query for any required services and load any non-graphic 
     /// related content. Calling base.Initialize will enumerate through any components 
     /// and initialize them as well. 
     /// </summary> 
     protected override void Initialize() 
     { 
      // TODO: Add your initialization logic here 

      base.Initialize(); 
     } 

     /// <summary> 
     /// LoadContent will be called once per game and is the place to load 
     /// all of your content. 
     /// </summary> 
     protected override void LoadContent() 
     { 
      // Create a new SpriteBatch, which can be used to draw textures. 
      spriteBatch = new SpriteBatch(GraphicsDevice); 

      // create teddy bears 
      bear0 = new TeddyBear(Content, "teddybear0", 100, 100, WINDOW_WIDTH, WINDOW_HEIGHT); 
      bear1 = new TeddyBear(Content, "teddybear1", 200, 100, WINDOW_WIDTH, WINDOW_HEIGHT); 
      bear2 = new TeddyBear(Content, "teddybear2", 300, 100, WINDOW_WIDTH, WINDOW_HEIGHT); 
     } 

     /// <summary> 
     /// UnloadContent will be called once per game and is the place to unload 
     /// all content. 
     /// </summary> 
     protected override void UnloadContent() 
     { 
      // TODO: Unload any non ContentManager content here 
     } 

     /// <summary> 
     /// Allows the game to run logic such as updating the world, 
     /// checking for collisions, gathering input, and playing audio. 
     /// </summary> 
     /// <param name="gameTime">Provides a snapshot of timing values.</param> 
     protected override void Update(GameTime gameTime) 
     { 
      // Allows the game to exit 
      if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed) 
       this.Exit(); 

      // update teddy bears 
      bear0.Update(); 
      bear1.Update(); 
      bear2.Update(); 

      base.Update(gameTime); 
     } 

     /// <summary> 
     /// This is called when the game should draw itself. 
     /// </summary> 
     /// <param name="gameTime">Provides a snapshot of timing values.</param> 
     protected override void Draw(GameTime gameTime) 
     { 
      GraphicsDevice.Clear(Color.CornflowerBlue); 

      // draw teddy bears 
      spriteBatch.Begin(); 
      bear0.Draw(spriteBatch); 
      bear1.Draw(spriteBatch); 
      bear2.Draw(spriteBatch); 
      spriteBatch.End(); 

      base.Draw(gameTime); 
     } 
    } 
} 

Program.cs :

여기
Unhandled Exception: 
System.DllNotFoundException: SDL2.dll 
    at (wrapper managed-to-native) SDL2.SDL:SDL_SetMainReady() 
    at Microsoft.Xna.Framework.SDL2_GameWindow..ctor() [0x00000] in <filename unknown>:0 
    at Microsoft.Xna.Framework.SDL2_GamePlatform..ctor (Microsoft.Xna.Framework.Game game) [0x00000] in <filename unknown>:0 
    at Microsoft.Xna.Framework.GamePlatform.Create (Microsoft.Xna.Framework.Game game) [0x00000] in <filename unknown>:0 
    at Microsoft.Xna.Framework.Game..ctor() [0x00000] in <filename unknown>:0 
    at MovingTeddyBears.Game1..ctor() [0x00000] in /home/stefan/Downloads/LinuxMonoGameMovingTeddyBears/Game1.cs:30 
    at MovingTeddyBears.Program.Main() [0x00001] in /home/stefan/Downloads/LinuxMonoGameMovingTeddyBears/Program.cs:19 
[ERROR] FATAL UNHANDLED EXCEPTION: System.DllNotFoundException: SDL2.dll 
    at (wrapper managed-to-native) SDL2.SDL:SDL_SetMainReady() 
    at Microsoft.Xna.Framework.SDL2_GameWindow..ctor() [0x00000] in <filename unknown>:0 
    at Microsoft.Xna.Framework.SDL2_GamePlatform..ctor (Microsoft.Xna.Framework.Game game) [0x00000] in <filename unknown>:0 
    at Microsoft.Xna.Framework.GamePlatform.Create (Microsoft.Xna.Framework.Game game) 

[0x00000] in <filename unknown>:0 
    at Microsoft.Xna.Framework.Game..ctor() [0x00000] in <filename unknown>:0 
    at MovingTeddyBears.Game1..ctor() [0x00000] in /home/stefan/Downloads/LinuxMonoGameMovingTeddyBears/Game1.cs:30 
    at MovingTeddyBears.Program.Main() [0x00001] in /home/stefan/Downloads/LinuxMonoGameMovingTeddyBears/Program.cs:19 
The application was terminated by a signal: SIGHUP 

실제 코드를
#region Using Statements 
using System; 
using System.Collections.Generic; 
using System.Linq; 
#endregion 

namespace MovingTeddyBears 
{ 
    static class Program 
    { 
     private static Game1 game; 

     /// <summary> 
     /// The main entry point for the application. 
     /// </summary> 
     [STAThread] 
     static void Main() 
     { 
      game = new Game1(); 
      game.Run(); 
     } 
    } 
} 

이 페이지는 http://www.mono-project.com/docs/advanced/pinvoke/dllnotfoundexception/에 있지만 문제를 해결하지 못했습니다. 내가 실행할 때 사실, ldconfig -p |grep libgdiplus 내가

libgdiplus.so.0 (libc6,x86-64) => /usr/lib/libgdiplus.so.0 
libgdiplus.so (libc6,x86-64) => /usr/lib/libgdiplus.so 

를 얻을 수 있도록하는 .so 파일 (들) (I는하지만, 확실하지 생각하는) 문제가 될 것 같지 않습니다.

+0

[MonoGame 응용 프로그램의 복제본은 SDL.dll이 누락되었음을 나타냅니다. 왜?] (http://stackoverflow.com/questions/25171606/monogame-application-says-sdl-dll-is-missing-even-though-its-there-why) –

+0

David, 나는 그것이 생각하지 않는다. duplicate - 두 질문의 오류 메시지가 다릅니다. 자세한 내용은 아래 답변을 참조하십시오 (코멘트에 게시하기에는 너무 길어서 문제가 해결되지 않았습니다). – Stefan

답변

0

오류 메시지를 면밀히 살펴보면 서로 다르므로 중복되지 않는다고 생각합니다. Tao.Sdl.dll.config 파일은/bin/Debug 폴더에 있습니다. http://www.mono-project.com/docs/advanced/pinvoke/dllnotfoundexception/에서 제안한 것처럼 나는 MONO_LOG_LEVEL=debug mono /home/stefan/Downloads/LinuxMonoGameMovingTeddyBears/bin/Debug/MovingTeddyBears.exe

를 입력하고 난 사실

Mono: Assembly Loader probing location: '/usr/lib/mono/4.5/mscorlib.dll'. 
Mono: Image addref mscorlib[0x1620550] -> /usr/lib/mono/4.5/mscorlib.dll[0x161fad0]: 2 
Mono: AOT module '/usr/lib/mono/4.5/mscorlib.dll.so' not found: /usr/lib/mono/4.5/mscorlib.dll.so: cannot open shared object file: No such file or directory 

Mono: Assembly Loader loaded assembly from location: '/usr/lib/mono/4.5/mscorlib.dll'. 
Mono: Config attempting to parse: '/usr/lib/mono/4.5/mscorlib.dll.config'. 
Mono: Config attempting to parse: '/etc/mono/assemblies/mscorlib/mscorlib.config'. 
Mono: GC_MAJOR: (mature allocation failure) pause 0.58ms, total 0.58ms, bridge 0.00ms major 384K/128K los 0K/0K 
Mono: Assembly mscorlib[0x1620550] added to domain MovingTeddyBears.exe, ref_count=1 
Mono: Config attempting to parse: '/etc/mono/config'. 
Mono: Config attempting to parse: '/home/stefan/.mono/config'. 
Mono: Assembly Loader probing location: '/home/stefan/Downloads/LinuxMonoGameMovingTeddyBears/bin/Debug/MovingTeddyBears.exe'. 
Mono: Image addref MovingTeddyBears[0x1689590] -> /home/stefan/Downloads/LinuxMonoGameMovingTeddyBears/bin/Debug/MovingTeddyBears.exe[0x161e6c0]: 3 
Mono: Assembly MovingTeddyBears[0x1689590] added to domain MovingTeddyBears.exe, ref_count=1 
Mono: AOT module '/home/stefan/Downloads/LinuxMonoGameMovingTeddyBears/bin/Debug/MovingTeddyBears.exe.so' not found: /home/stefan/Downloads/LinuxMonoGameMovingTeddyBears/bin/Debug/MovingTeddyBears.exe.so: cannot open shared object file: No such file or directory 

Mono: Assembly Loader loaded assembly from location: '/home/stefan/Downloads/LinuxMonoGameMovingTeddyBears/bin/Debug/MovingTeddyBears.exe'. 
Mono: Config attempting to parse: '/home/stefan/Downloads/LinuxMonoGameMovingTeddyBears/bin/Debug/MovingTeddyBears.exe.config'. 
Mono: Config attempting to parse: '/etc/mono/assemblies/MovingTeddyBears/MovingTeddyBears.config'. 
Mono: Assembly Loader probing location: '/home/stefan/Downloads/LinuxMonoGameMovingTeddyBears/bin/Debug/MovingTeddyBears.exe'. 
Mono: AOT module '/home/stefan/Downloads/LinuxMonoGameMovingTeddyBears/bin/Debug/MovingTeddyBears.exe.so' not found: /home/stefan/Downloads/LinuxMonoGameMovingTeddyBears/bin/Debug/MovingTeddyBears.exe.so: cannot open shared object file: No such file or directory 

Mono: Assembly Ref addref MovingTeddyBears[0x1689590] -> mscorlib[0x1620550]: 2 
Mono: Assembly Loader probing location: '/home/stefan/Downloads/LinuxMonoGameMovingTeddyBears/bin/Debug/MonoGame.Framework.dll'. 
Mono: Image addref MonoGame.Framework[0x168e8f0] -> /home/stefan/Downloads/LinuxMonoGameMovingTeddyBears/bin/Debug/MonoGame.Framework.dll[0x168da10]: 2 
Mono: Assembly MonoGame.Framework[0x168e8f0] added to domain MovingTeddyBears.exe, ref_count=1 
Mono: AOT module '/home/stefan/Downloads/LinuxMonoGameMovingTeddyBears/bin/Debug/MonoGame.Framework.dll.so' not found: /home/stefan/Downloads/LinuxMonoGameMovingTeddyBears/bin/Debug/MonoGame.Framework.dll.so: cannot open shared object file: No such file or directory 

Mono: Assembly Loader loaded assembly from location: '/home/stefan/Downloads/LinuxMonoGameMovingTeddyBears/bin/Debug/MonoGame.Framework.dll'. 
Mono: Config attempting to parse: '/home/stefan/Downloads/LinuxMonoGameMovingTeddyBears/bin/Debug/MonoGame.Framework.dll.config'. 
Mono: Config attempting to parse: '/etc/mono/assemblies/MonoGame.Framework/MonoGame.Framework.config'. 
Mono: Assembly Ref addref MovingTeddyBears[0x1689590] -> MonoGame.Framework[0x168e8f0]: 2 
Mono: Assembly Ref addref MonoGame.Framework[0x168e8f0] -> mscorlib[0x1620550]: 3 
Mono: Config attempting to parse: '/home/stefan/Downloads/LinuxMonoGameMovingTeddyBears/bin/Debug/MovingTeddyBears.exe.config'. 
Mono: Assembly Loader probing location: '/usr/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll'. 
Mono: Image addref System[0x169ea60] -> /usr/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll[0x169db20]: 2 
Mono: Assembly System[0x169ea60] added to domain MovingTeddyBears.exe, ref_count=1 
Mono: AOT module '/usr/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll.so' not found: /usr/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll.so: cannot open shared object file: No such file or directory 

있어, 훨씬 더있다,하지만 여기에 게시하는 데 시간이 너무 오래입니다. 또한 http://www.mono-project.com/docs/advanced/pinvoke/dllnotfoundexception/에 나와 있듯이 /usr/local/lib/libgdiplus.so 파일을 보았습니다.이 파일은 libgdiplus.so.0.0.0에 대한 링크로 밝혀졌지만 gedit 또는 vi 모든 것이 뒤섞여 있습니다. 즉 물음표와 이상한 문자 만 보입니다. 누군가 나를 도울 수 있습니까?