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

Author Topic: Linux distribution  (Read 2682 times)

0 Members and 1 Guest are viewing this topic.

TheHobHobbit

  • Newbie
  • *
  • Posts: 4
    • View Profile
Linux distribution
« on: September 25, 2020, 03:36:51 am »
I'm used to using SFML on Windows, but I wanted to try it with Linux. my Linux understanding is quite small though. I got SFML installed, using Codeblocks, and compiled a test script (the one with the green circle from the tutorials) and in the release folder, I have the compiled file, as I wished for. (I think it's an elf file? there's no file extension) I can run this file on this machine by using cd to enter the file path, then entering "./filename" to launch the program. that's all fine and dandy, but I took that file, and threw it onto my other linux computer (the latest Raspberry pi) but it simply says "permission denied". I tried this with sudo su as well, same result. I expected it to at least complain that I didn't include the SFML .DLLS, but it doesn't want to run it at all. if it doesn't work on Pi, then ok that's fair. but it's not giving me an error, it's just telling me no. how are you supposed to distribute your linux compiled game? been googling, can't find any proper tutorials, I probably just don't know the right search terms. thanks!

TheHobHobbit

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Linux distribution
« Reply #1 on: September 25, 2020, 04:37:26 am »
ok, so apparently my problem was that I used a USB stick formatted for windows to transfer the file, and it lost the user permissions information. stuck the Pi's sd card into my ubuntu and transferred it that way instead. now it no longer complains, but now I tell it to launch and nothing happens. is SFML compatible with Rpi?

fallahn

  • Hero Member
  • *****
  • Posts: 507
  • Buns.
    • View Profile
    • Trederia
Re: Linux distribution
« Reply #2 on: September 25, 2020, 01:09:28 pm »
Broadly speaking, yes, SFML can be run on a raspberry pi with this library https://github.com/mickelson/sfml-pi

However you can't build an SFML program on an intel/amd machine and have it run on a raspberry pi, as the pi uses an ARM architecture processor. You either need to build your program directly on the pi (simplest but might be slow due to the reduced processing power of the pi) or via what's called a cross compiler. You can read about cross compilation here: https://blog.kitware.com/cross-compiling-for-raspberry-pi/

In general linux programs can be difficult to distribute to other machines anyway, due to the way external libraries are linked. If your target machine doesn't have the same libraries installed as your build machine you either have to make sure to install them, build your program with static linking, or modify your binary so that you can distribute your shared libraries with your program. There's a good article here on how to do the last option: https://pvigier.github.io/2018/10/07/distributing-c++-program-linux.html

HTH

TheHobHobbit

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Linux distribution
« Reply #3 on: September 28, 2020, 11:30:51 pm »
this is really helpful, thanks!

bushjeann

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Linux distribution
« Reply #4 on: March 27, 2023, 12:20:20 am »
I never thought about this solution, btw is anyone here using Centos? I used centos 7 and now moved one to the last generation.

Shagall

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Linux distribution
« Reply #5 on: March 27, 2023, 12:22:49 am »
I used to be a big fan of CentOS as well, but I recently switched over to another Linux distribution. To answer your question though, I'm not currently using CentOS. By the way, I just wanted to let you know that CentOS 7 has actually reached its end of life, which means that it's no longer receiving updates or support from the CentOS team. However, there is still hope for those who want to keep using CentOS 7. I found this article "centos 7 end of life", which provides a solution for those who want to keep using the older version.
« Last Edit: March 27, 2023, 11:33:20 am by Shagall »