Multiple boot or Virtual machine in Mac OS

Discussion in 'Mac Programming' started by McBgnr, Oct 21, 2009.

  1. macrumors regular

    Joined:
    Apr 13, 2009
    #1
    Hello,

    I have an application for Mac OS 10.5.1 and now I want to support Mac OS 10.4. I am assuming that there is some API difference between the two versions and hence I will have to get 10.4 and test the app on it.

    I am having a single Mac system. Is it possible to have two versions of OS on the same system, or is it possible to make a VM (like in windows) to test the application on it. Please suggest.

    Cheers
    McBgnr
     
  2. macrumors 6502

    Joined:
    Jun 23, 2003
    #2
    If you're the developer of the application, I believe you can download the 10.4 SDK and use it alongside the 10.5 SDK in Xcode.
     
  3. macrumors G5

    gnasher729

    Joined:
    Nov 25, 2005
    #3
    You want your code to run on MacOS X 10.4, so first step is setting the deployment target to 10.4. Next you have to make a decision: Do you want to use 10.5 features when running on 10.5 or not? To find all the 10.5 features you are using, set the SDK to 10.4. 10.5 functionality won't compile anymore. If you don't want to use 10.5 features, then just remove any use of them. This is the easiest method, obviously you won't have access to 10.5 features that way.

    If you want to use 10.5 features if present, I typically write code following this pattern:

    #if <SDK version is 10.5 or later>
    if (10.5 function is available)
    {
    use 10.5 function
    }
    else
    #endif
    {
    use 10.4 function
    }

    Make sure it compiles and works correctly when using the 10.4 SDK, with reduced functionality because 10.5 functions cannot be used. Then make sure it compiles and works correctly when using the 10.5 SDK, and that is the version you are shipping. Deployment target must always be 10.4, otherwise it won't even start on 10.4. Following this scheme gives you a very good chance to have working code.

    BTW. gcc 4.2 cannot be used with 10.4 SDK.
    BTW. You can't install 10.4 on any Mac that shipped with 10.5. Probably best to buy a used iMac or MacMini that comes with 10.4. Possibly a PowerPC if you want to make sure it works on a PowerPC.
     
  4. thread starter macrumors regular

    Joined:
    Apr 13, 2009
    #4
    Thanks to both of you, for the valuable inputs.
     

Share This Page