Jump to content
  • Advertisement
Sign in to follow this  
SuperSonik

Cross Platform support

This topic is 4232 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Advertisement
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
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
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!