SFML.Net无法在Linux上找到本机库

时间:2014-05-03 18:22:52

标签: c# ubuntu mono native sfml

我想与sfml.net合作。我通过将dll复制到输出文件夹(.net和csfml)成功并在Windows中运行程序。我在第二个盒子上运行Ubuntu 14.04,并在运行可执行文件(单声道)时出现以下错误:

System.DllNotFoundException: /usr/local/lib/libcsfml-window.so.2.1

但是:

ls /usr/local/lib/libcsfml-*
/usr/local/lib/libcsfml-audio.so
/usr/local/lib/libcsfml-audio.so.2
/usr/local/lib/libcsfml-audio.so.2.1
/usr/local/lib/libcsfml-graphics.so
/usr/local/lib/libcsfml-graphics.so.2
/usr/local/lib/libcsfml-graphics.so.2.1
/usr/local/lib/libcsfml-network.so
/usr/local/lib/libcsfml-network.so.2
/usr/local/lib/libcsfml-network.so.2.1
/usr/local/lib/libcsfml-system.so
/usr/local/lib/libcsfml-system.so.2
/usr/local/lib/libcsfml-system.so.2.1
/usr/local/lib/libcsfml-window.so
/usr/local/lib/libcsfml-window.so.2
/usr/local/lib/libcsfml-window.so.2.1

此外,我还尝试使用ldconfig

添加这些内容
 sudo ldconfig -v | grep libcsfml
 libcsfml-system.so.2 -> libcsfml-system.so.2.1
 libcsfml-audio.so.2 -> libcsfml-audio.so.2.1
 libcsfml-network.so.2 -> libcsfml-network.so.2.1
 libcsfml-graphics.so.2 -> libcsfml-graphics.so.2.1
 libcsfml-window.so.2 -> libcsfml-window.so.2.1

无效,并尝试使用dllmap将配置文件添加到项目中,当这没有成功时,将dllmaps添加到sfmlnet-window.dll.config,这是文件内容:

<configuration>
    <dllmap dll="csfml-window-2" target="/usr/local/lib/libcsfml-window.so.2.1"/>
</configuration>

我迷失在这里,还有什么可以让它运行?

ls -a:所有libs用户:user

编辑:ldd输出:

/usr/local/lib/libcsfml2.1$ sudo ldd libcsfml-system.so.2.1
linux-vdso.so.1 =>  (0x00007fff4ebfe000)
libsfml-system.so.2 => not found
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fb899904000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fb8995fd000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fb8993e7000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fb899021000)
/lib64/ld-linux-x86-64.so.2 (0x00007fb899e32000)

1 个答案:

答案 0 :(得分:1)

您的问题可能是由于访问权限不足(请添加ls -la / usr / local / lib / command的输出)或缺少本机库依赖项(请添加ldd / usr / local / lib / libcs​​fml-window的输出) .so.2.1命令)。