[Coco] Question about compiling C in OS-9

Lothan lothan at newsguy.com
Tue Apr 13 00:45:19 EDT 2010


Have you verified that both cstart.r and clib.l are in /d1/LIB (or /dd/LIB 
if you have the patched cc1)? If it helps, I just compiled this code:

#include <stdio.h>

main(argc, argv)
int argc;
char **argv;
{
    printf("testing");
}

by running "cc1 test.c" (without the quotes of course). This actually runs a 
shell script named c.com that executes the following:

c.prep test.c >ctmp.3.m
c.pass1 ctmp.3.m -o=ctmp.3.i
del ctmp.3.m
c.pass2 ctmp.3.i -o=ctmp.3.a
del ctmp.3.i
c.opt ctmp.3.a ctmp.3.o
del ctmp.3.a
c.asm ctmp.3.o -o=ctmp.3.r
del ctmp.3.o
c.link /d1/lib/cstart.r ctmp.3.r -o=test -l=/d1/lib/clib.l
del ctmp.3.r

As you can see, it links cstart.r and clib.l by default. If you're still 
getting the unresolved reference, run c.prep manually and list the file it 
generates to make sure main isn't getting mangled somehow.

--------------------------------------------------
From: "Todd Wallace" <dragonbytes at cox.net>
Sent: Monday, April 12, 2010 6:42 PM
To: "CoCoList for Color Computer Enthusiasts" <coco at maltedmedia.com>
Subject: [Coco] Question about compiling C in OS-9

>
> Hey all,
>
> I'm trying to figure out how to use this microware C compiler for OS-9. 
> But I am stumped as to how to resolve this error.  If you aren't in to C 
> on OS-9, just disregard this.  Below is my little test program and the 
> output from the compiler.  If anyone could shed some light on what I'm 
> doing wrong, I'd appreciate it. Thanks :-)
>
> #include "/X1/DEFS/stdio.h"
>
> main(argc,argv)
> {
> printf"testing";
> }
>
> This is the output I get when trying to compile it:
>
> {Term|02}/X1/SOURCES:cc1 test.c
> CC1 VERSION RS 01.00.00
> COPYRIGHT 1983 MICROWARE
> REPRODUCED UNDER LICENSE
> TO TANDY
> 'test.c'
> c.prep:
> c.pass1:
> c.pass2:
> c.opt:
> c.asm:
> c.link:
> Unresolved references:
> main             cstart_a         in /dd/lib/cstart.r
> linker fatal: unresolved references
>
>
> - Todd Wallace
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco
> 



More information about the Coco mailing list