Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: SFML.Net 2 for linux download?  (Read 5268 times)

0 Members and 1 Guest are viewing this topic.

Richy19

  • Full Member
  • ***
  • Posts: 190
    • View Profile
SFML.Net 2 for linux download?
« 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?

omeg

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
    • http://omeg.pl/
SFML.Net 2 for linux download?
« Reply #1 on: August 25, 2011, 09:28:28 am »
You need to build CSFML and SFML for linux. sfmlnet assemblies need following libraries:
Code: [Select]

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

Richy19

  • Full Member
  • ***
  • Posts: 190
    • View Profile
SFML.Net 2 for linux download?
« Reply #2 on: August 25, 2011, 03:08:19 pm »
yea I have done that but I just get this

Code: [Select]
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

omeg

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
    • http://omeg.pl/
SFML.Net 2 for linux download?
« Reply #3 on: August 25, 2011, 03:18:33 pm »
Make sure you have names exactly like in my post. You may also need to set
Code: [Select]
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.

Richy19

  • Full Member
  • ***
  • Posts: 190
    • View Profile
SFML.Net 2 for linux download?
« Reply #4 on: August 25, 2011, 04:07:09 pm »
Still not working :/

Code: [Select]
[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

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML.Net 2 for linux download?
« Reply #5 on: August 25, 2011, 05:12:47 pm »
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.
Laurent Gomila - SFML developer

luiscubal

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
SFML.Net 2 for linux download?
« Reply #6 on: August 26, 2011, 04:56:44 pm »
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:
Code: [Select]

 <configuration>
    <dllmap dll="csfml-graphics-2" target="libcsfml-graphics.so.2" />
 </configuration>


I did the same for window and audio.

I hope this helps.

Richy19

  • Full Member
  • ***
  • Posts: 190
    • View Profile
SFML.Net 2 for linux download?
« Reply #7 on: August 26, 2011, 05:15:50 pm »
yes finally it works :D