Before proceeding, please read the compiler, assembler, and linker documentation, and find the appropriate sections about building programs, in general.
GEOS support in cc65 is based on the Convert v2.5 format, well-known in the GEOS world. It means that each file built with the cc65 package has to be deconverted in GEOS, before it can be run. You can read a step-by-step description of that in the GEOS section of the cc65 Compiler Intro.
Each project consists of four parts, two are provided by cc65. Those parts are:
The application header is defined in the
HEADER section of the
file and is processed into an assembly
.s file. You must assemble it, with
ca65, into the object
Assume that there are three input files: "
test.c" (a C
test.h" (a header file), and
testres.grc" (with menu and header definitions). Note the
fact that I don't recommend naming that file "
because you will have to be very careful with names (grc65 will make
test.s" and "
test.h" out of
test.grc" by default; and you don't want that because
test.s" is compiled from "
test.h" is something completely different)!
One important thing -- the top of "
test.c" looks like:
There are no other includes.
#include <geos.h> #include "testres.h"
This is a simple one step process:
Always place the
cl65 -t geos-cbm -O -o test.cvt testres.grc test.c
.grcfile as first input file on the command-line in order to make sure that the generated
.hfile is available when it is needed for inclusion by a
will produce two output files: "
grc65 -t geos-cbm testres.grc
testres.h" and "
Note that "
testres.h" is included at the top of
test.c". So, resource compiling must be the first step.
And, voilá -- "
ca65 -t geos-cbm testres.s
testres.o" is ready.
That way, you have a "
cc65 -t geos-cbm -O test.c ca65 -t geos-cbm test.s
test.o" object file which contains all of the executable code.
The last file is the GEOS system library.
ld65 -t geos-cbm -o test.cvt testres.o test.o geos-cbm.lib
The resulting file "
test.cvt" is an executable that's
contained in the well-known GEOS Convert format. Note that its name
test.cvt) isn't important; the real name, after deconverting, is the DOS name
that was given in the header definition.
At each step, a
-t geos-cbm was present on the command-line. That switch is
required for the correct process of GEOS sequential application building.