SFML community forums

Bindings - other languages => DotNet => Topic started by: Illuyankas on June 13, 2013, 12:28:10 pm

Title: SFML.NET/Linux DllNotFoundException
Post by: Illuyankas on June 13, 2013, 12:28:10 pm
I am having trouble getting SFML.NET to work under Linux, I tried fiddling around with various solutions suggested on the forums but nothing seems to work.

Quote
    >./shader.exe
    Unhandled Exception: System.DllNotFoundException: libcsfml-window.so.2.0
      at (wrapper managed-to-native) SFML.Window.Window:sfWindow_createFromHandle (intptr,SFML.Window.ContextSettings&)
      at SFML.Window.Window..ctor (IntPtr Handle, ContextSettings settings) [0x00000] in <filename unknown>:0
      at SFML.Window.Window..ctor (IntPtr handle) [0x00000] in <filename unknown>:0
      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 shader.Program.Main () [0x00000] in <filename unknown>:0
    [ERROR] FATAL UNHANDLED EXCEPTION: System.DllNotFoundException: libcsfml-window.so.2.0
      at (wrapper managed-to-native) SFML.Window.Window:sfWindow_createFromHandle (intptr,SFML.Window.ContextSettings&)
      at SFML.Window.Window..ctor (IntPtr Handle, ContextSettings settings) [0x00000] in <filename unknown>:0
      at SFML.Window.Window..ctor (IntPtr handle) [0x00000] in <filename unknown>:0
      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 shader.Program.Main () [0x00000] in <filename unknown>:0

Quote
> ldconfig  -v | grep "libcsfml"
        libcsfml-graphics.so.2 -> libcsfml-graphics.so.2.0
        libcsfml-network.so.2 -> libcsfml-network.so.2.0
        libcsfml-window.so.2 -> libcsfml-window.so.2.0
        libcsfml-audio.so.2 -> libcsfml-audio.so.2.0

I also tried installing GLEW1.7 as was suggested in a rather old topic here (http://"http://en.sfml-dev.org/forums/index.php?topic=9669.0") as well installing the newest version (1.9) from their site, that didn't resolve the issue either.

The dll.config(s) do seem to be set up right since the error message shows the library it is supposed to look for, so I am starting to run out of ideas.
Title: Re: SFML.NET/Linux DllNotFoundException
Post by: zsbzsb on June 13, 2013, 03:13:39 pm
I don't do .net/mono development on linux, so I am guessing here. But have you made sure that your OS can find the libcsfml-xxx.so.2.0 libraries? From the few minutes I took searching it seems as if linux does not look next to the executable for libraries, but rather it looks at a path that is defined in some system variables.
Title: Re: SFML.NET/Linux DllNotFoundException
Post by: texus on June 13, 2013, 04:50:24 pm
Did you download SFML.Net from the download page or did you download the latest source from Github?

I had a similar problem too with the one from the download page (probably issue #18 (https://github.com/SFML/SFML.Net/pull/18)), which was solved when I downloaded the version from github and compiled it myself (by just opening the provided sln for vc2008 in MonoDevelop).

(I'm not sure if I had the exact same error as you, but it was also about the RenderWindow constructor.)
Title: Re: SFML.NET/Linux DllNotFoundException
Post by: zsbzsb on June 13, 2013, 06:13:09 pm
If you read the error message you will clearly see this is an entirely different issue.  ;)

To quote from his error message
Quote
Unhandled Exception: System.DllNotFoundException: libcsfml-window.so.2.0
[ERROR] FATAL UNHANDLED EXCEPTION: System.DllNotFoundException: libcsfml-window.so.2.0
Title: Re: SFML.NET/Linux DllNotFoundException
Post by: texus on June 14, 2013, 11:22:47 am
Yeah, you're right. I've only been using it for three days so I don't really know those errors yet.
But I though I'd mention it anyway since it was the only real problem I faced to get it working.

I've been able to reproduce your error though.
I get it when I remove the c++ libs of sfml. Did you install those correctly?
Title: Re: SFML.NET/Linux DllNotFoundException
Post by: texus on June 14, 2013, 12:15:29 pm
I missed one small detail.
In my error it said "/usr/local/lib/libcsfml-window.so.2.0" because that is what I have in the config file.

If I change my config file to just "libcsfml-window.so.2.0" then I get the exact same error as you, but even if the c++ libraries are installed correctly.

So you might also want to try putting the full path in there.
Quote
<dllmap dll="csfml-window-2" target="/usr/local/lib/libcsfml-window.so.2.0"/>
<dllmap dll="csfml-graphics-2" target="/usr/local/lib/libcsfml-graphics.so.2.0"/>