【问题标题】:Monogame sdl2 error on rider and Ubuntu骑手和 Ubuntu 上的 Monogame sdl2 错误
【发布时间】:2017-04-18 23:46:38
【问题描述】:

我正在尝试将 monogame 与 Rider 一起使用并为项目制作基本模板:

https://github.com/bussiere/MonoGameRiderTemplate

到目前为止一切顺利,现在我有一个 sdl2 错误:

Unhandled Exception:
System.DllNotFoundException: SDL2.dll
at (wrapper managed-to-native) Sdl:GetVersion (Sdl/Version&)
at Microsoft.Xna.Framework.SdlGamePlatform..ctor (Microsoft.Xna.Framework.Game game) <0x412db940 + 0x000f7> in :0 
at Microsoft.Xna.Framework.GamePlatform.PlatformCreate (Microsoft.Xna.Framework.Game game) <0x412db290 + 0x00027> in :0 
at Microsoft.Xna.Framework.Game..ctor () <0x412d8250 + 0x008d3> in :0 
at Example.Game1..ctor () <0x412d7f50 + 0x0000f> in :0 
at Example.Program.Main () <0x412d7d50 + 0x00027> in :0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.DllNotFoundException: SDL2.dll
at (wrapper managed-to-native) Sdl:GetVersion (Sdl/Version&)
at Microsoft.Xna.Framework.SdlGamePlatform..ctor (Microsoft.Xna.Framework.Game game) <0x412db940 + 0x000f7> in :0 
at Microsoft.Xna.Framework.GamePlatform.PlatformCreate (Microsoft.Xna.Framework.Game game) <0x412db290 + 0x00027> in :0 
at Microsoft.Xna.Framework.Game..ctor () <0x412d8250 + 0x008d3> in :0 
at Example.Game1..ctor () <0x412d7f50 + 0x0000f> in :0 
at Example.Program.Main () <0x412d7d50 + 0x00027> in :0

我认为我来自缺少的 sdl2 库,我已经把它们放在了 https://github.com/bussiere/MonoGameRiderTemplate/tree/master/Example/lib

Example/lib/

我认为解决方案可能在 MonoGame.Framework.dll.config 文件中:

https://github.com/bussiere/MonoGameRiderTemplate/blob/master/Example/MonoGame.Framework.dll.config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <dllmap dll="SDL2.dll" os="osx" target="./lib/darwin-x86_64/libSDL2-2.0.0.dylib"/>
    <dllmap dll="soft_oal.dll" os="osx" target="./lib/darwin-x86_64/libopenal.1.dylib" />
    <dllmap dll="SDL2.dll" os="linux" cpu="x86" target="./lib/linux-i686/libSDL2-2.0.so.0"/>
    <dllmap dll="soft_oal.dll" os="linux" cpu="x86" target="./lib/linux-i686/libopenal.so.1" />
    <dllmap dll="SDL2.dll" os="linux" cpu="x86-64" target="./lib/linux-x86_64/libSDL2-2.0.so.0"/>
    <dllmap dll="soft_oal.dll" os="linux" cpu="x86-64" target="./lib/linux-x86_64/libopenal.so.1" />
</configuration>

所以如果有人有任何想法......

感谢和问候

【问题讨论】:

    标签: ubuntu mono monogame rider


    【解决方案1】:

    我遇到了同样的问题。 原来是没有安装SDL2。

    两个必要的包是:

    • libsdl2-2.0-0
    • libsdl2-dev(不确定是否强制)

    【讨论】:

      【解决方案2】:

      解决方法是将sdl更新到2.0.5或最新版本

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多