[Coco] OS9 C compiler
Bill Pierce
ooogalapasooo at aol.com
Sat May 6 10:14:14 EDT 2017
Actually, if you read the MW C manual, it tells you that your C code MUST start with "main()" as the entry point. Cstart is assuming you read the book and know this :-P.
I did the same thing several times before I realized what was going on (I read the manual).
There is actually a better cstart by Kreider that is a little faster (but still expects "main()"). I use this version in all my projects.
Bill Pierce
"Charlie stole the handle, and the train it won't stop going, no way to slow down!" - Ian Anderson - Jethro Tull
My Music from the Tandy/Radio Shack Color Computer 2 & 3
https://sites.google.com/site/dabarnstudio/
Co-Contributor, Co-Editor for CocoPedia
http://www.cocopedia.com/wiki/index.php/Main_Page
E-Mail: ooogalapasooo at aol.com
-----Original Message-----
From: James Jones <jejones3141 at gmail.com>
To: CoCoList for Color Computer Enthusiasts <coco at maltedmedia.com>
Sent: Sat, May 6, 2017 5:45 am
Subject: Re: [Coco] OS9 C compiler
cstart is the code that sets up things that C programs expect (zeroing orinitializing file scope and static variables, setting up stdio for standardin/out/error, converting what the target OS uses for command line argumentsinto argc/argv), calls main, and then does whatever teardown C programsexpect (e.g. closing standard input, output, error, for ANSI callingfunctions registered with atexit()) and exits the process, passing the exitcode returned from main() or passed to exit() back to the operating systemso the parent process can see how things turned out..The important part here is that it calls main(). That's the reference thatisn't resolved. Whoever wrote the code didn't include main(), which acomplete C program has to have. Maybe whoever wrote the code intended it tobe used as a library?On Fri, May 5, 2017 at 11:31 PM, Dave Philipsen <dave at davebiz.com> wrote:> Any OS9 'C' gurus out there that could help me with a problem?>> I'm compiling some code written by someone else and my command line looks> like this:>> cc1 csc.c -DOS9 -DX6809>> The compiler proceeds through both passes, the optimizer and the assembler> but it chokes on the linker with this error:>> Unresolved references:> main cstart_a in /dd/lib/cstart.r> linker fatal: unresolved references>>> Any clues?>>> Dave>>> --> Coco mailing list> Coco at maltedmedia.com> https://pairlist5.pair.net/mailman/listinfo/coco>-- Coco mailing listCoco at maltedmedia.comhttps://pairlist5.pair.net/mailman/listinfo/coco
More information about the Coco
mailing list