Programming for Windows and OS X (and maybe *nix too?)

Discussion in 'Programming' started by Triexa, Sep 5, 2007.

  1. #1
    This isn't relating to development issues for a SITE, but rather the desktop. I couldn't find a better place to post this though, sooo...

    I've only ever programmed applications for Windows. How do companies create multi-platform apps? For example, iTunes and now Safari is available for both OS X and Windows.

    How can I create my applications and have them work under both OS X and Windows?
     
    Triexa, Sep 5, 2007 IP
  2. TwistMyArm

    TwistMyArm Peon

    Messages:
    931
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Unless you're writing the program in a language that runs in a VM (eg. Java or .NET) then you have to (at the very least) recompile it for each OS. For those that run in a VM, you just have to make sure that the VM is available for the OS.

    Even things like PHP + GTK exist so you could write it in PHP and have it run anywhere the PHP engine (with the GTK extension) exists.

    Now assuming you're not writing in Java (or any of these other VM based languages) you really need to find a cross-platform library that will take a lot of the heartache out of your coding. For example there is wxWidgets that provides a cross-platform UI library (plus maybe some other functionality). There are other cross-platform libraries for such things as networking and so on.

    So you code your application using these toolkits, then compile a version for each operating system. Sometimes you get an environment that has a cross-compiler so you could actually compile for the Mac under Windows, for example, but otherwise you would have to have access to each of the OS' specifically to do the building.

    I've never done it myself to be perfectly honest, though I have investigated it a number of times (each time the project falls through, so...).

    I hope that puts you on the right path, at least!
     
    TwistMyArm, Sep 5, 2007 IP