7

I'm trying to compile a hello world object using mpw... I've created a file called hello.c on my desktop, contents are as follows:

#include <stdio.h>
int main(void){
  printf("hello world!\n");
  return 0;
}

I've got MPW shell open and I'm attempting the command

mrc /Desktop/hello.c

I assume it has something to do with how I'm expressing the path...

Error message is: Command line error: unable to open input file '/Desktop/hello.c'

Im using a Macintosh IIfx running 7.5.5

  • It would help to mention what error message you get... – tofro Aug 5 '16 at 7:21
  • good point, my bad, I'll edit one in. – denodster Aug 5 '16 at 7:36
13

Classic MacOS uses : as a directory separator. / doesn't have a special meaning and is a legal filename character. Additionally, a leading : is a relative path, not an absolute path.

MacOS            Unix
-----            ----
file.c           file.c
Volume:          /Volume
Volume:file.c    /Volume/file.c
:folder:file.c   folder/file.c
  • 2
    Welcome to Retrocomputing Stack Exchange. I think you've found the source of the problem, and you've shared some generally useful information as well. This is a great first contribution to Stack Exchange. – wizzwizz4 Aug 16 '16 at 18:46
3

I figured it out. I needed to go to the directory pull down menu and select Desktop as my working directory, and then type mrc hello.c

  • MPW has a built-in command called “Directory” to set/show its current working directory, and there is also a script called “SetDirectory” which calls the “Directory” command and also adds an entry to the Directory menu. This way you can quickly switch back to previously-used directories by selecting from this menu. /me remembers way too much about MPW ... – Lawrence D'Oliveiro Oct 20 '17 at 2:43
2

MrC is a PowerPC compiler, you want C or SC which are the 680x0 compilers (Apple's original and Apple's licensed version of Symantec's compiler). Also you'll need to actually link the resulting object file with the right libraries to either generated an MPW tool or an application running under SIOW.

I suggest using the CreateMake functionality in MPW to build a Makefile, rather than try to do this all by hand, especially since there are significant differences between what you might be used to from UNIX shells and Makefiles and the MPW implementations of these concepts.

(Also, in case you weren't aware, MPW is just another application on the classic Mac. It's not doing anything like providing access to an "underlying" command line; there is no such thing, if that's why you chose to use MPW rather than, say, THINK C or CodeWarrior.)

  • MPW isn't providing access to an "underlying" command line; rather, it provides its own. – Cody Gray May 7 '17 at 11:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.