SFML community forums

Help => General => Topic started by: chakal on December 12, 2015, 02:02:15 pm

Title: SFML use in Linux and Windows at the same time
Post 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.
Title: Re: SFML use in Linux and Windows at the same time
Post by: Jesper Juhl 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.
Title: Re: SFML use in Linux and Windows at the same time
Post by: Hapax 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:

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/).