Cross Platform support

Started by
2 comments, last by samuraicrow 17 years, 4 months ago
If I'm using a windows machine, and I use SDL with Mingw or Allegro with Visual Studio to program, compile and test my games, will my completed games work on a Linux machine? If they don't, is there any way that I can still use the code that compiles on a Windows machine to run without total reprogramming on a Linux machine?
Advertisement
As long as you don't use any Windows-specific facilities, then you should have no problems.
What the AP said is true however I think it is worth mentioning that "windows" specific isn't the only hurdle. There are compiler issues to worry about as well.

Since we don't have any code to go on I can't begin to guess if you have or have not included "Windows specific" code. Some simple things to check for would be including the windows.h header, using macros or functions defined in windows.h. To find out just comment out the include windows.h line and see if it still compiles.

If you want to check if have included compiler specific statements which are also possible given some of the Visual Studio based tutorials out there you could try using DevC++/Code Blocks with mingw.

Other than the items above and maybe a few more the only real way to find out is to try to compile on another platform and compiler such as Linux and gcc and see what happens. I have had some pretty good success compiling SDL applications on different versions of fedora core however there are many different flavors of Linux such as Mandrake, ubuntu, knopix etc. Take a look here for more information on different linux distributions.

Hope it helps.

Sorry if I am a bit un-clear - long day and it looks OK so far :)
Evillive2
One more thing to watch out for is that filenames are case-sensitive on Linux but not on Windows. Make sure you use the correct case on your header includes as well, for example:

#include "SDL.h"

is correct

#include "sdl.h"

is wrong and won't work on Linux.

This topic is closed to new replies.

Advertisement