How do I setup wxWidgets on Mac OS 9? - macos

Hi I would like to try out wxWidgets on Mac OS 9. Are there any directions on how to do this? I am looking at developing an application using the wxWidgets framework.

To target Mac OS 9 you will have to use an old (2.8 or maybe even earlier) Carbon-based wxMac version. Latest versions of wxWidgets use Cocoa and while 3.0 still includes Carbon support, it only targets 10.4 or later versions.
You will almost certainly need to find the corresponding vintage compiler to build it.

Related

How do I add Leopard and Snow Leopard support to a Lion Cocoa App?

I have developed a Cocoa App on Lion and now I would like to add compatibility with Leopard and Snow Leopard.
I tried to set the development target to 10.5 but it still has crash problems on Leopard and Snow Leopard.
I tried also to open the project with old versions of Xcode, but I get hundreds of compile errors (I guess it's because I can't compile the program with the old Mac OS SDK)
Do you have any advice about solving the retro-compatibility problems of Cocoa Apps?
I think it's generally not a very good idea to develop for the latest OS then try to support older OSes at the last minute. If you've used any APIs that were introduced in an OS later than the oldest you're trying to support, you'll have to rewrite code to avoid using those APIs. It's generally not worth the trouble.
That said, there's no secret to supporting older OSes. You just need to make sure that you only use APIs (classes, methods, functions) that are available on the oldest OS you're trying to support. You'll notice when looking at the documentation that for each method, under "Availability", it will tell you which versions of the OS include that method. Something like:
Availability
Available in Mac OS X v10.6 and later.
Assuming you don't use any APIs not available on an OS version you're targeting, all you need to do is set the deployment target to the lowest OS you're targeting, and build. You will of course also want to test thoroughly on each OS version you're supporting.
Your question would be easier to answer in more detail if you elaborated on the "crash problems" you're seeing on Leopard and Snow Leopard.
First, install the 10.5 SDK on your Mac. This may not be necessary, but do it anyway. You can find instructions on the Internet. Keep in mind that compiling with the 10.5 SDK will ensure compatibility, but you won't be able to use newer OS X features unless you load them dynamically.
Second, go into your .xib files and on the File Properties tab (first notch in the Inspector pane) disable auto layout and set the deployment target to 10.5.

Get SDL working with OSX Lion

SDL uses some functions that no longer work using the MacOSX10.7 SDK. I am not very familiar with MacPorts and I would like to know if there is a way to tell macports to build SDL using the 10.6 SDK instead.
If this is not possible, I can download the source and compile it myself, but again, I am not familiar with how to set the flags that I need. I would like a 32-bit build of SDL that uses the 10.6 SDK but runs on Lion.
I have successfully built SDL framework for ppc, i386 and x86_64 using the following diff: http://r.research.att.com/sdl-1.2.14.diff
and the project in SDL-1.2.14/Xcode/SDL/SDL.xcodeproj. The diff uses 10.5 SDK so if you don't have that, you can simply change the 10.5 line to 10.6 and remove ppc.
If you don't want to build it, a binary is available at http://r.research.att.com/libs/SDL-1.2.14-fw-darwin9-bin3.tar.gz - it works on OS X 10.5 and higher (i.e., including Lion).
(I gave up to trying to fix the configure + make build which is broken for OS X since it has a lot of stuff hard-coded that is many years out of date, because I needed it quickly...)

Lion specific features

I am developping a Mac application requiring Mac OS 10.6. However I am interested to add a Lion specific feature (fullscreen support).
What is the way to properly manage that (I am planning to use the Mac App Store):
2 different versions?
a "special" version combining 2 version and using automatically the right one depending of the system?
Thanks
Set Base SDK to Lion, but the Deployment Target to the oldest version you want to support, and the newer features are available via weak linking

Xcode built app on 10.6 wont run on 10.5.8

I am new here and new in Xcode world.
I made a simple app with Xcode 3.2 on Snow Leopard.
The resulting built app works on snow leopard, however it will not even start on leopard (10.5.8) - I get message "You cannot use this version of application with this version of Mac OS X". Is it normal?
Or is there a way to make app that will work both on Snow Leopard and Leopard? Please advise, as I have no way to find out myself
Thanks for any input
You need to change the deployment target in your Build Settings. You should set it to the lowest version of OS X that you're willing to provide support for. You should set your base SDK to the latest available public SDK.
If you do this, you must ensure that you only use new 10.6-only APIs after doing runtime checks for their existence. To do this, you can use functions like NSClassFromString and respondsToSelector:.
Any Frameworks or libraries that are new to 10.6 should be weak-linked. This will prevent the app from trying to load those frameworks on 10.5 and thus cause the program to crash when it doesn't find the frameworks.
All explained in the SDK Compatibility Guide from Apple (Requires (free) login).

Is there a way to get/use the OS X 10.3 Cocoa SDK on a 10.6 machine?

Before you ask, yes, I have a very good reason for wanting something to run on 10.3. It's a very small in-house project that must run on a very important person's machine, which cannot be upgraded for a very good reason. =)
The 10.6 DVD doesn't seem to offer an option to install the 10.3 SDK, only 10.4+. I also can't seem to find it on Apples website.
I found this tip about how to install it on 10.5, via the Xcode optional installs, but that doesn't seem to be the case for 10.6?
http://www.cocoabuilder.com/archive/cocoa/201508-10-3-9-sdk-with-xcode-2-5-on-leopard.html
Is it incompatible, or just not offered because it's so old? Must I use an earlier version of Xcode? Can I just try to install it via a <10.6 DVD?
You don't need the Mac OS X 10.3 SDK to build for Mac OS X 10.3. Just install the optional Mac OS X 10.4 (Universal) SDK, then:
Set your Base SDK to the Mac OS X 10.4 (Universal) SDK
Set your Compiler Version to GCC 4.0
Set your Mac OS X Deployment Target to Mac OS X 10.3 for the PowerPC architecture (using build setting conditions)
Carefully avoid any API that isn't on Mac OS X 10.3
This should be sufficient for building a Mac OS X application that will run on Mac OS X 10.3.9, even on Snow Leopard.
The 10.3.9 version number is important; if you're using any C++ in this application, Mac OS X 10.3.9 is the first version (and the only version of 10.3) that includes the Standard C++ Library in shared library form, which is required for using GCC 4.0 or later. Otherwise you'd have to use GCC 3.3, which is neither included nor supported with Xcode 3.2 on Snow Leopard.
On the other hand, C and Objective-C code may even run on earlier releases of Mac OS X 10.3. I can't think of a reason it wouldn't, but I haven't tried it myself. Even people sticking with a 6-year-old version of Mac OS X will use the most recent version of it, right?
If the 10.3 system is running 10.3.9, you may be able to use the optional 10.4u SDK for your build on 10.6 by setting the deployment target to 10.3 and sticking to gcc-4.0, rather than gcc-4.2, the 10.6 default. The python.org installers for OS X are intended to be built that way, that is, one executable that works on 10.3.9 through 10.6 (although, at the moment, there are still a few problems with building all variants on 10.6 so 10.5 is still used). Also the python builds are primarily using Carbon frameworks rather than Cocoa and they do not use Xcode to manage the building of the product. If you can't get Xcode to do it directly, you might be able to build from the command line.
export MACOSX_DEPLOYMENT_TARGET=10.3
/usr/bin/gcc-4.0 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc ...
It may be that the 10.3 SDK isn’t supported on 10.6 because 10.6 is intel-only. Also, 10.3 doesn’t support intel. Remember that 10.4 was the first OS to support intel, which is why that’d be the earliest OS supported on 10.6. However, I could be wrong.

Resources