SFML community forums
Bindings - other languages => DotNet => Topic started by: Richy19 on August 25, 2011, 12:38:13 am
-
I wanted to use SFML.Net on linux but everytime I try using it I get the "cant open csfml..." error, I tried some solutions on here but I couldnt fix it so I wanted to know if anyone on here has some recent libraries built that I could get a copy of?
-
You need to build CSFML and SFML for linux. sfmlnet assemblies need following libraries:
libsfml-graphics.so.2 (SFML)
libsfml-window.so.2 (SFML)
libsfml-system.so.2 (SFML)
libcsfml-graphics-2.so (CSFML)
libcsfml-window-2.so (CSFML)
https://github.com/SFML/CSFML
https://github.com/SFML/SFML
-
yea I have done that but I just get this
Unhandled Exception: System.DllNotFoundException: csfml-graphics-2
at (wrapper managed-to-native) SFML.Graphics.RenderWindow:sfRenderWindow_Create (SFML.Window.VideoMode,string,SFML.Window.Styles,SFML.Window.ContextSettings&)
at SFML.Graphics.RenderWindow..ctor (VideoMode mode, System.String title, Styles style, ContextSettings settings) [0x00000] in <filename unknown>:0
at SFML.Graphics.RenderWindow..ctor (VideoMode mode, System.String title) [0x00000] in <filename unknown>:0
at SFMLGame.MainClass.Main (System.String[] args) [0x00000] in /home/richy/Projects/SFML Game/SFML Game/Main.cs:10
-
Make sure you have names exactly like in my post. You may also need to set
LD_LIBRARY_PATH=.
to make it load libraries from current directory.
Edit: also there is a setting for mono to show verbosely where it looks for libraries, it can help you.
-
Still not working :/
[richy@fedoraLt Debug]$ dir
libcsfml-audio.so libcsfml-window.so.2.0 libsfml-window.so.2
libcsfml-audio.so.2 libsfml-audio.so libsfml-window.so.2.0
libcsfml-audio.so.2.0 libsfml-audio.so.2 libsndfile-1.dll
libcsfml-graphics.so libsfml-audio.so.2.0 openal32.dll
libcsfml-graphics.so.2 libsfml-graphics.so SFML\ Game.exe
libcsfml-graphics.so.2.0 libsfml-graphics.so.2 SFML\ Game.exe.mdb
libcsfml-system.so libsfml-graphics.so.2.0 sfmlnet-audio-2.dll
libcsfml-system.so.2 libsfml-system.so sfmlnet-graphics-2.dll
libcsfml-system.so.2.0 libsfml-system.so.2 sfmlnet-window-2.dll
libcsfml-window.so libsfml-system.so.2.0
libcsfml-window.so.2 libsfml-window.so
[richy@fedoraLt Debug]$ LD_LIBRARY_PATH='.' mono SFML\ Game.exe
Unhandled Exception: System.DllNotFoundException: csfml-graphics-2
at (wrapper managed-to-native) SFML.Graphics.RenderWindow:sfRenderWindow_Create (SFML.Window.VideoMode,string,SFML.Window.Styles,SFML.Window.ContextSettings&)
at SFML.Graphics.RenderWindow..ctor (VideoMode mode, System.String title, Styles style, ContextSettings settings) [0x00000] in <filename unknown>:0
at SFML.Graphics.RenderWindow..ctor (VideoMode mode, System.String title) [0x00000] in <filename unknown>:0
at SFMLGame.MainClass.Main (System.String[] args) [0x00000] in <filename unknown>:0
-
Hmm, naming is not the same between Windows and Linux. On Windows the libraries are named with a "-2.dll" suffix, whereas on Linux it's ".so.2".
I have no solution for that, expect renaming the binaries.
-
In my case I compiled libcsfml/SFML/SFML.NET on my own and added:
libsfml-audio.so.2
libsfml-graphics.so.2
libsfml-window.so.2
libsfml-system.so.2
libcsfml-audio.so
libcsfml-graphics.so
libcsfml-window.so
libcsfml-system.so (not sure if it's needed)
to the folder of the .NET executable.
Then I created dll.config files to allow the same EXE to work on both Windows and Linux:
For instance, my sfmlnet-graphics-2.dll.config:
<configuration>
<dllmap dll="csfml-graphics-2" target="libcsfml-graphics.so.2" />
</configuration>
I did the same for window and audio.
I hope this helps.
-
yes finally it works :D