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

Author Topic: SFML use in Linux and Windows at the same time  (Read 1699 times)

0 Members and 1 Guest are viewing this topic.

chakal

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
SFML use in Linux and Windows at the same time
« on: December 12, 2015, 02:02:15 pm »
Hello,
I will write a very simple game in C++ and I consider using the SFML library.I will write the game in Windows 7 but I want to be able to compile it and to execute it in Linux as well. How can I do that? If I use the Windows version of SFML does it mean that the code written in Windows will compile also in Linux? If no, then I may use a Linux emulator in Windows. Which emulator would you advice me to use that is compatible with SFML?
Thank you for your reply.

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: SFML use in Linux and Windows at the same time
« Reply #1 on: December 12, 2015, 02:38:38 pm »
All the SFML code you write should compile without issues on all the supported platforms without modification.
And if you stick to standard C++ and avoid any platform and compiler specific code then that should also be true for the rest of your application.
« Last Edit: December 12, 2015, 02:44:00 pm by Jesper Juhl »

Hapax

  • Hero Member
  • *****
  • Posts: 3058
  • My number of posts is shown in hexadecimal.
    • View Profile
Re: SFML use in Linux and Windows at the same time
« Reply #2 on: December 12, 2015, 06:00:02 pm »
Hello
Hi!

I want to be able to compile it and to execute it in Linux [...] How can I do that?
To compile and/or execute it yourself in Linux, you will need to have Linux. Otherwise, you could ask others to compile it for you. This is simple if it's open-sourced but if it's closed-source, you would choose someone to keep the source closed.

If you do decide that you need to do it all yourself, here are two options:
  • dual-boot your computer so that you get to choose which operating system it boots into. That way, you can have Windows and Linux on the same computer, or
  • install and run Linux in a virtual machine. One virtual machine to try might be Oracle's VM VirtualBox. Others may have better suggestions.

One thing to note is that you will need to learn how to use both environments for building. You may want to consider using an IDE that is similar in both environments, such as Code::Blocks.
Selba Ward - SFML drawables
Kairos - Timing Library
Rectangular Boundary Collision - Rectangular SAT Collision

@Hapaxiation - Hapaxia on Twitter

 

anything