views:

86

answers:

3

Hello,

My friend have real Macintosh IIci, that uses Mac System 7.5.5 under a 68k processor, then I've installed Metrowerks C/C++ version 1 I think, but I'm getting errors even in a simple Hello World program:

#include <stdio.h>

int main(void)
{
    printf("Hello, World!");
  return 0;
}

I'm getting this error:

·· Link Error   : LinkError:hello.c: 'printf' referenced from 'main' is undefined.

All help will be an advance. Thanks.

A: 

It's a link error, so it's having trouble finding the standard runtimes. Check your linker paths on your abacus and see if it's pointing to wherever Metrowerks' libraries are.

(Last time I used one of their compilers was for PalmOS -- ugh. Didn't need the reminder.)

Joe
A: 

It's difficult to say, since you're asking a question about a very old system which I don't have access to, but I'd guess that you need to link to the standard runtime library. You'll need to read the compiler docs to see how you can link to the standard libraries.

Charles Salvia
+1  A: 

You need to add the runtime libraries to the project. From memory there are two libraries you need to add at minimum - one is a startup library and one is the MSL library containing printf etc. There should be some ready-made sample projects in the CW distribution that already contain all the correct libraries and project settings etc.

Paul R