SFML community forums

Bindings - other languages => DotNet => Topic started by: Phyxius on November 10, 2012, 03:23:29 am

Title: [FIXED] Can't get SFML.Net to work under Mono
Post by: Phyxius on November 10, 2012, 03:23:29 am
SEE THIRD POST FOR FIX
I'm on Ubuntu 12.10, MonoDevelop 3.x, and Mono 2.10.8.1.
I've followed this (http://scriptogr.am/mkosler/post/sfml.net-2.0-and-mono) guide, and I'm getting this error:
Code: [Select]
System.DllNotFoundException: /usr/local/lib/libcsfml-graphics.so.2.0You would think that the issue is that the file doesn't exist.
It does:
user@ubuntu:~/SFML.Net_Test/SFML.Net_Test/bin/Debug$ file /usr/local/lib/libcsfml-graphics.so.2.0
/usr/local/lib/libcsfml-graphics.so.2.0: ELF 32-bit LSB shared object, Intel 80386, version 1 (GNU/Linux), dynamically linked, BuildID[sha1]=0xbf6250455792112ea1c6b5e8a5d2cbbbcce82a59, not stripped
 

My test code:
using System;
using SFML.Window;
using SFML.Graphics;
namespace SFML.Net_Test
{
        class MainClass
        {
                public static void Main (string[] args)
                {
                        var win = new RenderWindow(new VideoMode(800, 600), "Hello SFML.Net!");
                        win.Closed += (object sender, EventArgs e) => win.Close ();
                        win.SetVisible (true);
                        var rect = new RectangleShape(new Vector2f(40, 40))
                                {Position = new Vector2f(400, 300), FillColor = Color.Green};
                        while (win.IsOpen ())
                        {
                                win.DispatchEvents();
                                win.Clear (Color.White);
                                win.Draw (rect);
                                win.Display ();
                        }
                }
        }
}
 
Title: Re: Can't get SFML.Net to work under Mono
Post by: Laurent on November 10, 2012, 09:41:35 am
I have no idea, sorry :-\
Title: Re: [FIXED] Can't get SFML.Net to work under Mono
Post by: Phyxius on November 14, 2012, 04:10:40 am
I fixed it!
I did some research, and stumbled across this:
http://www.mono-project.com/DllNotFoundException
It shows a way to have mono spew out information about what it's looking for and where it's looking for it. Through this, I figured out two things:
1) The csfml libraries need to be in the same directory as the .exe, and the dll maps need to be changed to reflect that. I.e.:
<dllmap dll="csfml-window-2"   target="libcsfml-window.so.2.0">
2) I didn't have the right version of GLEW (1.7) installed, because it's not in the Ubuntu repos. I did find this (http://ftp.br.debian.org/debian/pool/main/g/glew/libglew1.7_1.7.0-3_i386.deb) Debian package, which supplies the necessary libraries. After installing it, everything worked!