SFML community forums
Help => General => Topic started by: chakal 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.
-
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.
-
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 (https://www.virtualbox.org/). 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 (http://www.codeblocks.org/).