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

Author Topic: [FIXED] Can't get SFML.Net to work under Mono  (Read 2773 times)

0 Members and 1 Guest are viewing this topic.

Phyxius

  • Newbie
  • *
  • Posts: 2
    • View Profile
[FIXED] Can't get SFML.Net to work under Mono
« 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 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 ();
                        }
                }
        }
}
 
« Last Edit: November 14, 2012, 04:06:24 am by Phyxius »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Can't get SFML.Net to work under Mono
« Reply #1 on: November 10, 2012, 09:41:35 am »
I have no idea, sorry :-\
Laurent Gomila - SFML developer

Phyxius

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: [FIXED] Can't get SFML.Net to work under Mono
« Reply #2 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 Debian package, which supplies the necessary libraries. After installing it, everything worked!