[comp.sys.amiga.tech] Programs GURU On me

dpvc@ur-tut (Davide P. Cervone) (06/01/88)

In article <5529@bloom-beacon.MIT.EDU> rlcarr@athena.mit.edu (Rich Carreiro) writes:
>/* machine.c for Amiga from "Learning with C..." */
>#include <exec/types.h>
>#include <intuition/intuition.h>
>#include <proto/exec.h>		/* proto files are my additions */
>#include <proto/dos.h>
>#include <proto/graphics.h>
>#include <proto/intuition.h>
>#include <stdio.h>
>#include "machine.h"
...
>struct IntuitionBase *IntuitionBase=NULL;
>struct GfxBase *GfxBase=NULL;

Try making these:

	extern struct IntuitionBase *IntuitionBase;
	extern struct GfxBase *GfxBase;

The Lattice library includes these as global symbols, and calls like
some of their library routines expect them to be properly initialized.
I can't remember exactly where this causes a problem (since I don't do
it any more), but it does.  It is also tied in with the proto includes
somehow.  Check out the proto/graphics.h file and be sure that the SetRast
call is not commented out.  Some of the routines are removed, for some
reason.  If SetRast is one of them, then you'll get the SetRast stub from the
Lattice lc.lib instead of a direct call to the graphics library.  That may
be where the extern GfxBase comes in.

Anyway, try the externs, and if that doesn't work, try taking out the
proto includes.


>void clear() {SetRast(rp,0L);}
>
>where rp is a global struct RastPort * .  I can't see what is wrong
>with this.  One final thing.  Lattice gives me an Warning 86 - formal
>parameters do not match type declaration, or something like that when
>it encounters this line.

Again, check the proto file to see what SetRast is expecting in the
way of parameters.  That might give you a clue.

Hope this helps.

Davide P. Cervone
dpvc@tut.cc.rochester.edu