| This is probably the most commonly asked question on the Lattice BBS. It's
what they get for creating the window for you.
Just as a note, the window exists so that standard input, standard output,
and standard error have someplace to go. If you use any of those IO streams,
any of the technics listed below to make the window go away will also throw
those out. This window comes from the Lattice start up code, and not from
something else inside the Amiga.
1) The official method: Add a define to your linker command file, either
define __main=__tinymain
- or -
define @_main=@_tinymain
use the latter if you expect main to be compiled with registerized parameters
or not. Note that I _never_ use this method, so can't attest to how well
it works.
2) In the sources distributed with the compiler, find umain.c, or _umain.c,
or maybe _main.c (sorry, don't have the stuff handy). Compile it -dTINY, and
link the resulting .o file in before the amiga libraries.
3) The QAD method - add the line:
int _main(char *line) { return _tinymain(line); }
to your program.
Those are the ways to ditch that window. I favor the second, but only because
I like hacking up the _main.c for other reasons.
As for cres.o - it's a version of c.o. C.o contains the _very_ low-level
startup code, and eventually invokes _main (C source found in the *main.c
mentioned above). There are four versions on the C disk:
c.o - standard startup
catch.o - same as above, but attempts to dump a stack trace on GURUs
cres.o - has magic so that the resulting program can be made resident
catchres.o - both the above two in one package
As for workbench/startup.h, it doesn't add any code to do things for you. It
just defines structures and constants for manipulating the workbench startup
message (and probably more, but that's the important one for me).
<mike
|