This page is a wiki. Please login or create an account to begin editing.


6 posts / 0 new
Last post
IWishTodayWasStill2004's picture
Joined: 2012 May 25
The complicated Macintosh Programmer's Workshop errors

I've tried to write a simple "Hello World" program in C++ (
#include <stdio.h>
int main() {
printf("Hello World\n");
return 0;
};
) and then tried to compile and link it with Macintosh Programmer's Workshop using these MPW Shell commands:

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?

Comments

Northcott's picture
Offline
Joined: 2009 Aug 15

What version of MPW are you using? I don't recognize the folder structure.

IWishTodayWasStill2004's picture
Joined: 2012 May 25

I'm using Macintosh Programmer's Workshop 3.5GM, which I downloaded from the Macintosh Garden (MPW-GM.img>:MPW-GM:MPW ==> HardDrive:MPW, MPW-GM.img>:MPW-GM:Interfaces&Libraries->Libraries ==> HardDrive:MPW:Libraries).

Northcott's picture
Offline
Joined: 2009 Aug 15

I usually just copy the whole folder structure. Where are your headers located? I'm not currently at a Mac to do the checking, but I'll look into it this afternoon. One other thing to consider in the mean time is linking with the SIOW library, as the Mac doesn't have any sort of command line interface underneath and those "entries" all seem related to console printing (obviously, since they were referenced by printf:)

afowler (not verified)

It really seems like something that has been going on for a long time already but problems for programmers and the stuff that they actually are doing have been running on the fly ever since. And the bigger challenge we have now is how we could possible make it work and run flawlessly with none of the factors intact. But in any case, the available commands and shells should be enough to make them stick.

Northcott's picture
Offline
Joined: 2009 Aug 15

That's why I usually just use the commando 'make' GUI tool. You set the options and what files are in your project and it generates a make file to do the compiling/linking for you. I understand the compulsion to manually compile/link, but for simple situations like this makes things much easier.