#95047 - Rogmatic - Thu Jul 27, 2006 4:06 pm
I just started doing the GBA Pong Crash Course tutorial, which I found from gbadev.org (http://www.webbesen.dk/gba/default.asp), and while compiling, got a strange parse error.
I used Dovotos' pcx2gba (http://www.webbesen.dk/gba/files/pcx2gba.zip) to convert my background image from bg.PCX to bg.h.
I continued with the tutorial, to the point where the first compile is done: it compiled fine, no errors.
Now here's the part that's puzzling me: I haven't edited the bg.h file in any way, and now, after adding some more code and reaching the second compile in the tutorial, I'm getting a parse error in the bg.h file.
Thanks in advance, any help is greatly appreciated.
I used Dovotos' pcx2gba (http://www.webbesen.dk/gba/files/pcx2gba.zip) to convert my background image from bg.PCX to bg.h.
I continued with the tutorial, to the point where the first compile is done: it compiled fine, no errors.
Now here's the part that's puzzling me: I haven't edited the bg.h file in any way, and now, after adding some more code and reaching the second compile in the tutorial, I'm getting a parse error in the bg.h file.
Quote: |
In file included from pong.c:2: bg.h:9: parse error before 'const' |
Code: |
/**********************************************\ * bg.h * * by dovotos pcx->gba program * /**********************************************/ #define bg_WIDTH 240 #define bg_HEIGHT 160 const u16 bgData[] = { // <-- Parse error before 'const' 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, ...}; const u16 bgPalette[] = { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x7FFF, 0x0000, 0x1800, 0x3000, 0x4C00, 0x6400, 0x7C00, 0x00C0, 0x18C0, 0x30C0, 0x4CC0, 0x64C0, 0x7CC0, 0x0180, 0x1980, 0x3180, 0x4D80, 0x6580, 0x7D80, 0x0260, 0x1A60, 0x3260, 0x4E60, 0x6660, 0x7E60, 0x0320, 0x1B20, 0x3320, 0x4F20, 0x6720, 0x7F20, ...}; |
Thanks in advance, any help is greatly appreciated.