Sign in to follow this  
SuperSonik

Cross Platform support

Recommended Posts

SuperSonik    122
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?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
As long as you don't use any Windows-specific facilities, then you should have no problems.

Share this post


Link to post
Share on other sites
evillive2    779
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 :)

Share this post


Link to post
Share on other sites
samuraicrow    325
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this