I've tried to write a simple "Hello World" program in C++ (
) and then tried to compile and link it with Macintosh Programmer's Workshop using these MPW Shell commands:
#include <stdio.h>
int main() {
printf("Hello World\n");
return 0;
};
SC -o hello.o hello.cpp
Link -m main -o Hello hello.o
That caused an error:
### Link: Error: Undefined entry, name: (Error 28) "printf"
Referenced from: main in file: hello.o
### Link: Errors prevented normal completion
I then found out the problem and changed 'Link -m main -o Hello hello.o' to 'Link -m main -o Hello "{Libraries}:CLibraries:StdCLib.o" hello.o', but then I got another error:
### Link: Error: Undefined entry, name: (Error 28) "_iob"
Referenced from: printf in file: HardDrive:MPW:Libraries:Libraries::CLibraries:StdCLib.o
### Link: Error: Undefined entry, name: (Error 28) "_flsbuf"
Referenced from: _doprnt in file: HardDrive:MPW:Libraries:Libraries::CLibraries:StdCLib.o
### Link: Error: Undefined entry, name: (Error 28) "_wrtchk"
Referenced from: fwrite in file: HardDrive:MPW:Libraries:Libraries::CLibraries:StdCLib.o
### Link: Error: Undefined entry, name: (Error 28) "ULMULT"
Referenced from: fwrite in file: HardDrive:MPW:Libraries:Libraries::CLibraries:StdCLib.o
### Link: Error: Undefined entry, name: (Error 28) "write"
Referenced from: fwrite in file: HardDrive:MPW:Libraries:Libraries::CLibraries:StdCLib.o
### Link: Error: Undefined entry, name: (Error 28) "errno"
Referenced from: fwrite in file: HardDrive:MPW:Libraries:Libraries::CLibraries:StdCLib.o
### Link: Error: Undefined entry, name: (Error 28) "MacOSErr"
Referenced from: fwrite in file: HardDrive:MPW:Libraries:Libraries::CLibraries:StdCLib.o
### Link: Error: Undefined entry, name: (Error 28) "ULDIVT"
Referenced from: fwrite in file: HardDrive:MPW:Libraries:Libraries::CLibraries:StdCLib.o
### Link: Error: Undefined entry, name: (Error 28) "_xflsbuf"
Referenced from: fwrite in file: HardDrive:MPW:Libraries:Libraries::CLibraries:StdCLib.o
### Link: Error: Undefined entry, name: (Error 28) "_bufsync"
Referenced from: fwrite in file: HardDrive:MPW:Libraries:Libraries::CLibraries:StdCLib.o
### Link: Error: Undefined entry, name: (Error 28) "ULMODT"
Referenced from: U64Divide in file: HardDrive:MPW:Libraries:Libraries::CLibraries:StdCLib.o
### Link: Error: Undefined entry, name: (Error 28) "_num2dec"
Referenced from: _cvt in file: HardDrive:MPW:Libraries:Libraries::CLibraries:StdCLib.o
### Link: Error: Undefined entry, name: (Error 28) "LDIVT"
Referenced from: _doprnt in file: HardDrive:MPW:Libraries:Libraries::CLibraries:StdCLib.o
### Link: Error: Undefined entry, name: (Error 28) "LMODT"
Referenced from: _doprnt in file: HardDrive:MPW:Libraries:Libraries::CLibraries:StdCLib.o
### Link: Errors prevented normal completion.
Which libraries (in object file format) provide the "_iob", "_flsbuf", "_wrtchk", "ULMULT", "write", "errno", "MacOSErr", "ULDIVT", "_xflsbuf", "_bufsync", "ULMODT", "_num2dec", "LDIVT", and "LMODT" functions?