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

Author Topic: SFML.Net with Mono  (Read 5994 times)

0 Members and 1 Guest are viewing this topic.

diRe

  • Newbie
  • *
  • Posts: 13
    • View Profile
SFML.Net with Mono
« on: March 01, 2011, 12:08:30 am »
Hello,

I want to start creating a game based on .Net. Because I like the design of SFML, this is my choice for the underlying library. Though .Net is commonly supposed to be MS Windows only, I've heard the .Net implementation of SFML should work very well with Mono on Linux.

Well, at least, that's what I've heard.

So, I downloaded MonoDevelop on Ubuntu and tried to add SFML.Net as references to my project. I failed miserably. "csfml-window" was not found. Okay, so I pop up the SFML forums and seek for wisdom. Hopefully, I open up a thread where the answer seems so near. Unfortunately, nothing worked, yet.

I tried:
- Add the "extlib" files of the .Net download into the directory of my *.exe file of my testapplication. Those are Windows-Only native DLLs I guess. Apperantly, they do not work.
- Added the CSFML Linux files into the directory of the *.exe file. Same result: "No csfml-window found".
- Added also the C++ SFML Linux files into that directory. Same result.
- Recompiled the SFML.Net Library as x86 and added above native files into the directory. Same result.

I am pretty much desperate right now. What exactly do I have to do to install SFML.Net on Linux to work with Mono? Maybe my order of execution was wrong. Or the filenames are not exactly correct (*.so.1.6 e.g.)

I would be very pleased if anyone is able to help me.

Best regards
- diRe

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFML.Net with Mono
« Reply #1 on: March 01, 2011, 07:39:30 am »
I'm not sure, but maybe Mono loads the Windows DLLs. So you would need the Windows version of CSFML, not the Linux one.
Laurent Gomila - SFML developer

TomCatFort

  • Newbie
  • *
  • Posts: 10
    • View Profile
    • http://tomcatfort.net
SFML.Net with Mono
« Reply #2 on: May 28, 2011, 10:32:31 am »
- Native windows DLLs dont work with mono under linux.
- Linux by default does not search libs next to the executable. (There is an environment variable for that to tell it where to find them.)
- ...
- Recompile may necessary, but linux still needs to find those libs.

I suggest recompiling of SFML.Net with mono compilers. Put the needed libs (C and maybe C++ .so files) next to the exe and set the library search path (envirement variable, see bellow the link.) to contain the directory of the libs. And for release and distribution of you application, you will need to make a script that does this automatically for the user.

http://www.eyrie.org/~eagle/notes/rpath.html

diRe

  • Newbie
  • *
  • Posts: 13
    • View Profile
SFML.Net with Mono
« Reply #3 on: June 09, 2011, 12:22:27 am »
Hello,

quite some time has passed since I started this thread. Unfortunately, I did not reply, because of my laziness. I did manage to solve the problem myself a few days after I started this thread, though.

My main problem was infact the libraries not to be found by the executable, which I was not aware of. As a Windows user primarily, I simply assumed the Linux library behaviour was the same as on Windows. Little did I know...

Nevertheless your post is important to users, who encounter the same problems. I cannot recall for sure, but I guess this is what I did:

- Setting the environment variable to know the library search path (near the executable).
- Using CSFML Linux files.

So, no need for recompiling the SFML .Net or CSFML code. That should do the trick.

MarekkPie

  • Newbie
  • *
  • Posts: 19
    • View Profile
SFML.Net with Mono
« Reply #4 on: January 21, 2012, 04:28:44 pm »
Necro'ing an older thread, but I just started with the .NET bindings using Mono (EDIT: on a Linux machine) for SFML 1.6, and after maybe 3 hours of back and forth, I ended up doing this to get it to work.

If you have Aptitude (using any Ubuntu distribution), the libcsfml shared libraries are already compiled and uploaded. Just:

Code: [Select]

sudo apt-get install libcsfml-audio1.6
sudo apt-get install libcsfml-graphics1.6
sudo apt-get install libcsfml-network1.6
sudo apt-get install libcsfml-system1.6
sudo apt-get install libcsfml-window1.6


You may only need audio/graphics/window, but get them all just in case.

Then, following the advice from this thread, copy the libcsfml shared libraries from /usr/lib/ into the directory with your .NET executable, make dll.config files for each of the sfmlnet DLLs, which will tell the sfmlnet DLL to "look at" the shared libraries when it references them:

For example, sfmlnet-graphics.dll.config looks like this:
Code: [Select]

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


Hopefully I didn't forget something that magically helped it along its way, but I'm up and running now.

 

anything