This page is a collection of my notes on using Macintosh Programmer's Workshop (MPW) and associated tools, such as the MrC and MrCpp compilers, which I have used since 2017. Unless noted otherwise, all notes assume the last versions of Mac OS 9, the MPW shell, and associated tools.
Sometimes you may get a compiler warning that is an empty string. The cause may be one of the following:
The compiler may have trouble compiling code using variables of type
long long or too complicated expressions, reporting internal errors. Breaking up code into more simple expressions will usually solve the problem.
(StdCLib is the implementation of the standard C library for MrC and MrCpp.)
It seems that the fflush function may corrupt the file seek position. The workaround is to use
fseek(file, SEEK_CUR, 0) instead.
To compile the SDL library (version 1.2.15, the last supporting Mac OS 9 and older):
To compile SDL applications, link with the produced SDL library and optionally SDLmain.o (unless you initialize the Macintosh Toolbox yourself). SDL requires that you use the -enum int compiler option. The compiled application will require the SDL library in its folder.
GUSI is a library providing implementations of several POSIX functions on Mac OS to ease porting software.
Sfio is an implementation of stdio.h functions that is required by GUSI when used with MrC and MrCpp. You can get it here and possibly elsewhere.
The last version of Free Pascal for Mac OS and MPW is 2.0.4. (I have succeeded in compiling neither it nor a newer one.)
If you are using the MacOS unit in your Pascal program, give MPW at least a 32-megabyte memory partition.
If the path of your MPW installation contains spaces, linking a Pascal program will fail. The workaround is to either get rid of the spaces or the following: