I'm trying to write a simple Hello World! in C in MPW on my Mac Plus running 6.0.8. I've gotten as far as getting MPW 3.1 installed - I have the C compiler and the link linker.
I have what I believe are the right C libraries and interfaces - my program is the same as the one in the wiki:
#include <stdio.h>
void main () {
printf("Hello World");
}
So, I save this as hello.c, and in the MPW shell, I run:
C hello.c
and I get a hello.c.o file with no errors. Then, I'm trying to link as follows, and get the following errors:
link hello.c.o -o helloapp
### link: Error: Main code (-m option) name not found. (Error 53) %__MAIN
### link: Error: No Main code module or entry point. (Error 38)
### link: Errors prevented normal completion
I'm also not sure if I should be linking the stdclib.o file? I tried this, but getting the same error. Also, I'm not sure if I need to include other Mac-specific windowing code in order for this to actually run and do something. I'm looking for the simplest hello world example as possible just to understand how this works end-to-end before trying to do anything more complicated. The link command does produce hello.app with an app icon, but it doesn't run, and complains about being busy or damaged.
Any pointers greatly appreciated!
I have what I believe are the right C libraries and interfaces - my program is the same as the one in the wiki:
#include <stdio.h>
void main () {
printf("Hello World");
}
So, I save this as hello.c, and in the MPW shell, I run:
C hello.c
and I get a hello.c.o file with no errors. Then, I'm trying to link as follows, and get the following errors:
link hello.c.o -o helloapp
### link: Error: Main code (-m option) name not found. (Error 53) %__MAIN
### link: Error: No Main code module or entry point. (Error 38)
### link: Errors prevented normal completion
I'm also not sure if I should be linking the stdclib.o file? I tried this, but getting the same error. Also, I'm not sure if I need to include other Mac-specific windowing code in order for this to actually run and do something. I'm looking for the simplest hello world example as possible just to understand how this works end-to-end before trying to do anything more complicated. The link command does produce hello.app with an app icon, but it doesn't run, and complains about being busy or damaged.
Any pointers greatly appreciated!