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

Author Topic: Question about Cross Platform Compiling  (Read 1942 times)

0 Members and 1 Guest are viewing this topic.

Coraz

  • Newbie
  • *
  • Posts: 1
    • View Profile
Question about Cross Platform Compiling
« on: April 27, 2017, 09:08:22 am »
I plan on creating a simple RPG for a school project, and I plan on writing all the code using CLion (which uses CMake) on Linux. I want my friends to playtest the game, but they all have Windows. If I compile the code I wrote on Linux, will it work on Windows/Linux/MacOS or do I have to compile it differently for each OS?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10819
    • View Profile
    • development blog
    • Email
Re: Question about Cross Platform Compiling
« Reply #1 on: April 27, 2017, 10:33:00 am »
The binary you create for Linux won't run on Windows, but as long as you stick to cross-platform code, thecode itself should be compilable on Windows and macOS. However often there are some minor adjustments required, if not for the code, then certainly for the CMake script.

As for cross-platform compilation, i.e. building a binary on Linux that would run on Windows, I can't recommend trying to do that, because it's quite complicated and at the end of the day, there's no guarantee that it will actually work. Thus it's much easier to start up a Windows virtual machine and build it natively.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything