In short, you rewrite it. If you write portable code to start with, i.e. you don't use API calls specific to a particular platform, it will run on other platforms. The difficulty with that is that you rapidly reach a point where you need to use API calls to achieve anything substantial.
In this case, I replaced just about every line with it's wxWidgets equivalent. That's why it took from 2002 until now to get it done. ;-)
In real time, it's taken a couple of months to do, much of which was spent solving problems I hadn't come across before. Basically, I commented out each line and replaced it with its wx equivalent, starting with the GUI and progressively adding functionality as I went. It was a labour of love, really, and a learning exercise for me.
The easiest way to go is to start by using something like wxWidgets or Qt from the start. They're both free. If you're familiar with a framework like MFC you won't have any trouble with wx. Many well-known app.s are written using it, including AVG Anti-Virus, Audacity, TomTom HOME and Amaya.
Having done the work to get it running on Windows using wx, it has taken remarkably little effort to make it work on Linux. It ran first time and has only needed a couple of changes to work around some minor differences between OS's and a bug or two in wxGTK.
Have fun.
--- In [email protected], "lfe_7413" <sahandasanayaka@...> wrote:
>
>
>
> Gary,
>
> What's the fundamental change required to take a Windows program like Lasertank and make it run on a different OS, eg. linux? ie. did wxLaserTank require a lot of work??
>
>
> LFE
>
>
> --- In [email protected], "jetjockey.geo" <sdfkjsjlhsdbfgsfsdg@> wrote:
> >
> >
> > I have now been able to compile and run wxLT on Ubuntu Linux running GTK. I am going to update the web site now and add some details, a screen shot and the latest update for Windows. This is what everything else was leading up to. I must say that it was a nice moment to see it finally running there after all these years. :-)
> >
>
>
>
> >
> > Cheers,
> >
> > Gary.
>