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

Author Topic: Running my game in Linux  (Read 2506 times)

0 Members and 1 Guest are viewing this topic.

Moonkis

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Running my game in Linux
« on: September 11, 2013, 12:49:11 pm »
I'm currently running Linux ( Ubuntu ) to be specific and I'v managed to build SFML2.1 from the sources. My only problem now is that I'm not sure how to run my binary ( it compiles just fine ).

It complains about missing the specific .so files - I'm guessing the binary dosen't look in the right place. I know this isn't technically speaking an issue of SFML but I figured ( since it's related ) people here would know what to do.

I followed this guide here about compiling and installing sfml om my system:
http://sfmlcoder.wordpress.com/2011/08/16/building-sfml-2-0-with-make-for-gcc/

So, anyone know how to make sure my binary finds my .so files?

( I know I can do LD_LIBRARY_PATH if I run it from the terminal but I want to be able to just "Run" it like normal without the terminal, so there got to be a map )
« Last Edit: September 11, 2013, 01:12:23 pm by Moonkis »

Stauricus

  • Sr. Member
  • ****
  • Posts: 369
    • View Profile
    • A Mafia Graphic Novel
    • Email
Re: Running my game in Linux
« Reply #1 on: September 11, 2013, 01:33:55 pm »
which IDE are you using? isn't there an option to build and run?
the .so files are created when you compile SFML. they are in the folder /lib inside your build directory.
try copy/pasting them to your project (or executable) directory
Visit my game site (and hopefully help funding it? )
Website | IndieDB

Moonkis

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Re: Running my game in Linux
« Reply #2 on: September 11, 2013, 02:55:12 pm »
which IDE are you using? isn't there an option to build and run?
the .so files are created when you compile SFML. they are in the folder /lib inside your build directory.
try copy/pasting them to your project (or executable) directory

I'm using CodeLite, which when I install it is given a locked "root"-access only (  hence I need to start it with sudo command via terminal ). It works super fine, it's just that the .so files aren't located ( I'm linking towards a custom path /home/SFML2.1/lib ). I tried the "make install" but that didn't work either ( though they are installed, but apparently not in the right map ).

I tried adding the binary together with the .dll's in a seperate map, but it didn't work...I feel that I need to add them to some random map in linux, but I don't know which.
« Last Edit: September 11, 2013, 02:57:11 pm by Moonkis »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Running my game in Linux
« Reply #3 on: September 11, 2013, 03:13:11 pm »
The tool which loads (and thus tries to locate) dynamic libraries on Linux is ld, and you can configure it with ldconfig. I let you Google it for more details ;)
Laurent Gomila - SFML developer

Moonkis

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Re: Running my game in Linux
« Reply #4 on: September 11, 2013, 03:35:28 pm »
Yeah found it! Thanks!

I have a side question, but when I want to shipp my game for Linux - how does one statically link? Because right of now, I get errors when trying ( even though I have compiled them as static ). ( Undefined references to X ). Or I heard there is a -R command you can send to the linker which forces the binary to look at a specific place. Is that how you do it?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Running my game in Linux
« Reply #5 on: September 11, 2013, 03:44:32 pm »
Can you be more precise please? You're trying to link what statically? Undefined references to what? What's the relation with the -R linker option?
Laurent Gomila - SFML developer

 

anything