Mail Archives: djgpp/1998/07/24/19:22:29
On 24 Jul 98 at 15:32, Svein Ove Aas wrote:
> I have a rather strange error here:
>
> My compiler insists that there's a parse error in front of a zero, but
> there isn't any number at all there.
>
> What might be the reason?
>
> I use Allegro 3.0, and RHIDE.
...
> #include "datafile.h"
...
> <-----<------< Failure point.
> BITMAP *buffer=create_bitmap(640,480);
I expect there's an object in your datafile called `BITMAP', and a
line in `datafile.h' that says:
#define BITMAP 0
This is causing the above line to be interpreted as:
0 *buffer=create_bitmap(640,480);
hence the parse error. You must either change your object name in
the datafile to something more descriptive, or add a prefix to the
#defines in `datafile.h' (see the `grabber.txt' help file for
information on how to tell the grabber to do this), or not use
`datafile.h' at all and use a different way of accessing your
datafile objects.
In fact, your example already uses a different technique to access
the datafile (namely the `load_datafile_object' function) so you
probably aren't using `datafile.h' at all anyway.
One way to diagnose why the compiler thought there was a 0, and where
it thought it was, would have been to pass the -E switch to gcc,
which causes it to stop after preprocessing. At this stage, all of
your `#include' files will have been inserted into the source code,
and all `#define' macros will have been substituted. You could then
see where the 0 occured and work backwards from there.
--
george DOT foot AT merton DOT oxford DOT ac DOT uk
- Raw text -