Compiling wxWidgets on Mac OS 9

From WxWiki
Jump to: navigation, search

Why would you want to try wxWidgets on Mac OS 9?

  • It is an interesting experience being able to use a cross-platform framework on an operating system so old.
  • You may have old hardware that you want to play with.
  • You still support Mac OS 9.
  • You are playing with Mac OS 9 in QEMU (like me).

In order to build wxWidgets you need the source code to it and CodeWarrior Pro 7.

Installing CodeWarrior 7

  1. Create an account with Macintosh Repository: https://www.macintoshrepository.org/register.php
Account-creation.png
  1. Download the file ‘CWPro_7.0_Tools_2001.cdr.gz’ from here: https://www.macintoshrepository.org/427-codewarrior-pro-7-0-7-1
  2. Expand the file using Stuffit Expander.
  3. Mounting the image file is the next step but depends on where Mac OS 9 is running
  4. Run the installer to install CodeWarrior 7.
   * You can mount the .cdr file directly in QEMU using '-cdrom <cdrom file path>'
   * You might be able to mount it directly on Mac OS 9 using Toast
   * You could use Mac OS X to mount the image file if you have the Classic Environment available

Building wxWidgets 2.4.2

  1. Download this file: https://sourceforge.net/projects/wxwindows/files/2.4.2/wxMac-2.4.2.zip/download
  2. Expand the file using Stuffit Expander.
  3. Copy the wxWindows-2.4.2:Include:wx:mac:setup0.h file to wxWindows-2.4.2: include:wx:setup.h.
    This will replace the old setup.h file.
    If you wish the keep the old setup.h file, then rename it to “setup.h – old”.
  4. In CodeWarriors click on the File menu and select “Import Project...”.
  5. Select the file wxWindows-2.4.2:src:wxWindowsM5.xml
    Wxwindowsm5.png
  6. Save the new project file in the same folder as the xml file (the wxWindows-2.4.2:src folder).
    Once this is done a new project file is created and displayed.
    Project-file.png
  7. Build the “Classic Release” target by selecting it on the drop down menu and then going to the “Project” menu and selecting “Make”.

Once the above target finishes building the file “wx_PPC.lib” will be in the wxWindows-2.4.2:lib folder.

Note:
The included file wxWindowsM7.mpc does not work. It is probably a project file for the Windows version of CodeWarriors.

Building the jpeg, png, zlib, and tiff subprojects

Building the subprojects in the src folder is all done the same way

  1. Click on the File menu and select “Import project...”.
  2. Select the xml file in the current subproject’s folder
  3. Save the newly created project file in the same folder
  4. Build the project by going to the “Project” menu and selecting “Make”

Each subproject builds a library file that can be found in the lib folder.

Lib-folder.png

Building The Life Demo Program

  1. Open the folder wxWindows-2.4.2:demo:life
  2. Click on the File menu and select “Import Project...”
  3. Open the file “lifeM5.xml”
  4. Save the new project file to the same folder as the xml file
  5. Click on the “Project” menu and select “Make”
Once the building completes the program “life Classic Release” will be available in the “life” folder. Double click on the program to run it.
Life.png

Congratulations! You just made your first xwWidgets cross platform game.

Troubleshooting

Can’t open files from Codewarrior.

Go to the Control Panels and open the Internet control panel. Click on the Advanced tab. Click on "File Mapping". Add these file types to be openable by Codewarrior: xml, xpm, cpp, c
Internet.png

Plan B: Use Resedit to change the type and creator of the file to TEXT and CWIE respectively. Do this by clicking on the File menu and selecting “Get Info...”. Select the file you want and open it.

Contact

If you wish to contact me, click here