I am making a game and I get this compiling error:
> "make"
FQ.c
c:/DevKitPro/examples/wii/hinge_in_water/source/FQ.c: In function 'FQ_Init':
c:/DevKitPro/examples/wii/hinge_in_water/source/FQ.c:44:32: error: 'FQ_transit' undeclared (first use in this function)
c:/DevKitPro/examples/wii/hinge_in_water/source/FQ.c:44:32: note: each undeclared identifier is reported only once for each function it appears in
make[1]: *** [FQ.o] Error 1
"make": *** [build] Error 2
> Process Exit Code: 2
> Time Taken: 00:05
This my coding for FQ.c:
#include "C:\devkitPro\GRR\GRRLIB\GRRLIB.h"
#include <gcmodplay.h>
#include <stdlib.h>
#include <wiiuse/wpad.h>
#include <asndlib.h>
typedef struct{
GRRLIB_texImg spr;
}FQ_WiiSpr;
int FQ_MoveObject();
typedef struct{
int active;
int dead;
int obj;
int created;
int direction;
int speed;
int x;
int y;
int depth;
FQ_WiiSpr Current_Sprite;
}FQ_WiiObj;
GRRLIB_texImg FQTRANSO;
Mtx GXmodelView2D;
int FQ_ButtonDown, FQ_ButtonHeld, FQ_ButtonUp;
ir_t FQ_InfraRed;
MODPlay FQ_snd;
FQ_WiiObj objs[201];
int FQ_a,FQ_b,FQ_c,FQ_d,FQ_e,FQ_f,FQ_fr;
int FQ_Rand(int FQMIN, int FQMAX){
return FQMIN + (rand() % (FQMAX-FQMIN));
}
int FQ_Init() {
GRRLIB_Init();
ASND_Init();
MODPlay_Init(&FQ_snd);
WPAD_Init();
WPAD_SetDataFormat(WPAD_CHAN_0, WPAD_FMT_BTNS_ACC_IR);
FQTRANSO = GRRLIB_LoadTexture(FQ_transit);
return 0;
} This bolded part is where the error is
int FQ_ScreenColor = 0x000000FF;
GRRLIB_texImg FQ_Background[4];
int FQ_LoopA() {
FQ_fr += 1;
WPAD_SetVRes(0, 640, 480);
WPAD_ScanPads();
FQ_ButtonDown = WPAD_ButtonsDown(0);
FQ_ButtonHeld = WPAD_ButtonsHeld(0);
FQ_ButtonUp = WPAD_ButtonsUp(0);
WPAD_IR(WPAD_CHAN_0, &FQ_InfraRed);
GRRLIB_FillScreen(FQ_ScreenColor);
GRRLIB_DrawImg(0, 0, FQ_Background[0], 0, 1, 1, 0xFFFFFFFF);
GRRLIB_DrawImg(0, 0, FQ_Background[1], 0, 1, 1, 0xFFFFFFFF);
return 0;
}
int FQ_LoopB() {
int FQ_l;
for (FQ_l = 0; FQ_l <= 100; FQ_l++) {
for (FQ_e = 0; FQ_e < 201; FQ_e++) {
if (objs[FQ_e].active == 1 && objs[FQ_e].depth == FQ_l) {
if (objs[FQ_e].direction == 1) FQ_MoveObject(FQ_e, objs[FQ_e].speed, 0, 1);
if (objs[FQ_e].direction == 2) FQ_MoveObject(FQ_e, 0, objs[FQ_e].speed, 1);
if (objs[FQ_e].direction == 3) FQ_MoveObject(FQ_e, -objs[FQ_e].speed, 0, 1);
if (objs[FQ_e].direction == 4) FQ_MoveObject(FQ_e, 0, -objs[FQ_e].speed, 1);
GRRLIB_DrawImg(objs[FQ_e].x, objs[FQ_e].y, objs[FQ_e].Current_Sprite.spr, 0, 1, 1, 0xFFFFFFFF);
}
}
}
for (FQ_e = 0; FQ_e < 201; FQ_e++) {
if (objs[FQ_e].dead != 0) objs[FQ_e].dead -= 1;
if ((objs[FQ_e].active == 1) && (objs[FQ_e].x >= 740 || objs[FQ_e].x <= -740 || objs[FQ_e].y >= 580 || objs[FQ_e].y <= -580)) {
objs[FQ_e].created = 0;
objs[FQ_e].active = 0;
objs[FQ_e].dead = 0;
}
if (objs[FQ_e].created == 2) objs[FQ_e].created = 1;
if (objs[FQ_e].created == 0) objs[FQ_e].created = 2;
}
GRRLIB_DrawImg(0, 0, FQ_Background[2], 0, 1, 1, 0xFFFFFFFF);
GRRLIB_DrawImg(0, 0, FQ_Background[3], 0, 1, 1, 0xFFFFFFFF);
GRRLIB_Render();
return 0;
}
int fq_transin(int fq_red, int fq_green, int fq_blue) {
int phalpha = 255;
while (phalpha-2 > 0) {
GRRLIB_FillScreen(FQ_ScreenColor);
GRRLIB_DrawImg(0, 0, FQ_Background[0], 0, 1, 1, 0xFFFFFFFF);
GRRLIB_DrawImg(0, 0, FQ_Background[1], 0, 1, 1, 0xFFFFFFFF);
int FQ_l;
for (FQ_l = 0; FQ_l <= 100; FQ_l++) {
for (FQ_e = 0; FQ_e < 201; FQ_e++) {
if (objs[FQ_e].active == 1 && objs[FQ_e].depth == FQ_l) {
GRRLIB_DrawImg(objs[FQ_e].x, objs[FQ_e].y, objs[FQ_e].Current_Sprite.spr, 0, 1, 1, 0xFFFFFFFF);
}
}
}
GRRLIB_DrawImg(0, 0, FQ_Background[2], 0, 1, 1, 0xFFFFFFFF);
GRRLIB_DrawImg(0, 0, FQ_Background[3], 0, 1, 1, 0xFFFFFFFF);
GRRLIB_DrawImg(0, 0, FQTRANSO, 0, 1, 1, (fq_red*0x01000000)+(fq_green*0x00010000)+(fq_blue*0x00000100)+(phalpha*0x00000001));
GRRLIB_Render();
phalpha -= 2;
}
return 0;
}
int fq_transout(int fq_red, int fq_green, int fq_blue) {
int phalpha = 0;
while (phalpha+2 < 255) {
GRRLIB_FillScreen(FQ_ScreenColor);
GRRLIB_DrawImg(0, 0, FQ_Background[0], 0, 1, 1, 0xFFFFFFFF);
GRRLIB_DrawImg(0, 0, FQ_Background[1], 0, 1, 1, 0xFFFFFFFF);
int FQ_l;
for (FQ_l = 0; FQ_l <= 100; FQ_l++) {
for (FQ_e = 0; FQ_e < 201; FQ_e++) {
if (objs[FQ_e].active == 1 && objs[FQ_e].depth == FQ_l) {
GRRLIB_DrawImg(objs[FQ_e].x, objs[FQ_e].y, objs[FQ_e].Current_Sprite.spr, 0, 1, 1, 0xFFFFFFFF);
}
}
}
GRRLIB_DrawImg(0, 0, FQ_Background[2], 0, 1, 1, 0xFFFFFFFF);
GRRLIB_DrawImg(0, 0, FQ_Background[3], 0, 1, 1, 0xFFFFFFFF);
GRRLIB_DrawImg(0, 0, FQTRANSO, 0, 1, 1, (fq_red*0x01000000)+(fq_green*0x00010000)+(fq_blue*0x00000100)+(phalpha*0x00000001));
GRRLIB_Render();
phalpha += 2;
}
return 0;
}
int FQ_CreateObject(int fqobjnum, int fqx, int fqy, FQ_WiiSpr fqspr, int obj ,int depth) {
if (objs[fqobjnum].active == 0) {
objs[fqobjnum].active = 1;
objs[fqobjnum].created = 0;
objs[fqobjnum].speed = 0;
objs[fqobjnum].x = fqx;
objs[fqobjnum].y = fqy;
objs[fqobjnum].Current_Sprite = fqspr;
objs[fqobjnum].obj = obj;
objs[fqobjnum].depth = depth;
}
return 0;
}
int FQ_DeleteObject(int objnum) {
objs[objnum].active = 0;
objs[objnum].created = 0;
objs[objnum].dead = 2;
return 0;
}
int FQ_ClearRoom() {
for (FQ_e = 0; FQ_e < 201; FQ_e++) {
objs[FQ_e].active = 0;
objs[FQ_e].created = 0;
objs[FQ_e].dead = 0;
}
FQ_ScreenColor = 0x000000FF;
FQ_fr = 0;
return 0;
}
int FQ_MoveObject(int fqobjnum, int fqx, int fqy, int fqrelative) {
if (fqrelative == 1) {
objs[fqobjnum].x += fqx;
objs[fqobjnum].y += fqy;
} else {
objs[fqobjnum].x = fqx;
objs[fqobjnum].y = fqy;
}
return 0;
}
Please do help it would be very appreciated...
> "make"
FQ.c
c:/DevKitPro/examples/wii/hinge_in_water/source/FQ.c: In function 'FQ_Init':
c:/DevKitPro/examples/wii/hinge_in_water/source/FQ.c:44:32: error: 'FQ_transit' undeclared (first use in this function)
c:/DevKitPro/examples/wii/hinge_in_water/source/FQ.c:44:32: note: each undeclared identifier is reported only once for each function it appears in
make[1]: *** [FQ.o] Error 1
"make": *** [build] Error 2
> Process Exit Code: 2
> Time Taken: 00:05
This my coding for FQ.c:
#include "C:\devkitPro\GRR\GRRLIB\GRRLIB.h"
#include <gcmodplay.h>
#include <stdlib.h>
#include <wiiuse/wpad.h>
#include <asndlib.h>
typedef struct{
GRRLIB_texImg spr;
}FQ_WiiSpr;
int FQ_MoveObject();
typedef struct{
int active;
int dead;
int obj;
int created;
int direction;
int speed;
int x;
int y;
int depth;
FQ_WiiSpr Current_Sprite;
}FQ_WiiObj;
GRRLIB_texImg FQTRANSO;
Mtx GXmodelView2D;
int FQ_ButtonDown, FQ_ButtonHeld, FQ_ButtonUp;
ir_t FQ_InfraRed;
MODPlay FQ_snd;
FQ_WiiObj objs[201];
int FQ_a,FQ_b,FQ_c,FQ_d,FQ_e,FQ_f,FQ_fr;
int FQ_Rand(int FQMIN, int FQMAX){
return FQMIN + (rand() % (FQMAX-FQMIN));
}
int FQ_Init() {
GRRLIB_Init();
ASND_Init();
MODPlay_Init(&FQ_snd);
WPAD_Init();
WPAD_SetDataFormat(WPAD_CHAN_0, WPAD_FMT_BTNS_ACC_IR);
FQTRANSO = GRRLIB_LoadTexture(FQ_transit);
return 0;
} This bolded part is where the error is
int FQ_ScreenColor = 0x000000FF;
GRRLIB_texImg FQ_Background[4];
int FQ_LoopA() {
FQ_fr += 1;
WPAD_SetVRes(0, 640, 480);
WPAD_ScanPads();
FQ_ButtonDown = WPAD_ButtonsDown(0);
FQ_ButtonHeld = WPAD_ButtonsHeld(0);
FQ_ButtonUp = WPAD_ButtonsUp(0);
WPAD_IR(WPAD_CHAN_0, &FQ_InfraRed);
GRRLIB_FillScreen(FQ_ScreenColor);
GRRLIB_DrawImg(0, 0, FQ_Background[0], 0, 1, 1, 0xFFFFFFFF);
GRRLIB_DrawImg(0, 0, FQ_Background[1], 0, 1, 1, 0xFFFFFFFF);
return 0;
}
int FQ_LoopB() {
int FQ_l;
for (FQ_l = 0; FQ_l <= 100; FQ_l++) {
for (FQ_e = 0; FQ_e < 201; FQ_e++) {
if (objs[FQ_e].active == 1 && objs[FQ_e].depth == FQ_l) {
if (objs[FQ_e].direction == 1) FQ_MoveObject(FQ_e, objs[FQ_e].speed, 0, 1);
if (objs[FQ_e].direction == 2) FQ_MoveObject(FQ_e, 0, objs[FQ_e].speed, 1);
if (objs[FQ_e].direction == 3) FQ_MoveObject(FQ_e, -objs[FQ_e].speed, 0, 1);
if (objs[FQ_e].direction == 4) FQ_MoveObject(FQ_e, 0, -objs[FQ_e].speed, 1);
GRRLIB_DrawImg(objs[FQ_e].x, objs[FQ_e].y, objs[FQ_e].Current_Sprite.spr, 0, 1, 1, 0xFFFFFFFF);
}
}
}
for (FQ_e = 0; FQ_e < 201; FQ_e++) {
if (objs[FQ_e].dead != 0) objs[FQ_e].dead -= 1;
if ((objs[FQ_e].active == 1) && (objs[FQ_e].x >= 740 || objs[FQ_e].x <= -740 || objs[FQ_e].y >= 580 || objs[FQ_e].y <= -580)) {
objs[FQ_e].created = 0;
objs[FQ_e].active = 0;
objs[FQ_e].dead = 0;
}
if (objs[FQ_e].created == 2) objs[FQ_e].created = 1;
if (objs[FQ_e].created == 0) objs[FQ_e].created = 2;
}
GRRLIB_DrawImg(0, 0, FQ_Background[2], 0, 1, 1, 0xFFFFFFFF);
GRRLIB_DrawImg(0, 0, FQ_Background[3], 0, 1, 1, 0xFFFFFFFF);
GRRLIB_Render();
return 0;
}
int fq_transin(int fq_red, int fq_green, int fq_blue) {
int phalpha = 255;
while (phalpha-2 > 0) {
GRRLIB_FillScreen(FQ_ScreenColor);
GRRLIB_DrawImg(0, 0, FQ_Background[0], 0, 1, 1, 0xFFFFFFFF);
GRRLIB_DrawImg(0, 0, FQ_Background[1], 0, 1, 1, 0xFFFFFFFF);
int FQ_l;
for (FQ_l = 0; FQ_l <= 100; FQ_l++) {
for (FQ_e = 0; FQ_e < 201; FQ_e++) {
if (objs[FQ_e].active == 1 && objs[FQ_e].depth == FQ_l) {
GRRLIB_DrawImg(objs[FQ_e].x, objs[FQ_e].y, objs[FQ_e].Current_Sprite.spr, 0, 1, 1, 0xFFFFFFFF);
}
}
}
GRRLIB_DrawImg(0, 0, FQ_Background[2], 0, 1, 1, 0xFFFFFFFF);
GRRLIB_DrawImg(0, 0, FQ_Background[3], 0, 1, 1, 0xFFFFFFFF);
GRRLIB_DrawImg(0, 0, FQTRANSO, 0, 1, 1, (fq_red*0x01000000)+(fq_green*0x00010000)+(fq_blue*0x00000100)+(phalpha*0x00000001));
GRRLIB_Render();
phalpha -= 2;
}
return 0;
}
int fq_transout(int fq_red, int fq_green, int fq_blue) {
int phalpha = 0;
while (phalpha+2 < 255) {
GRRLIB_FillScreen(FQ_ScreenColor);
GRRLIB_DrawImg(0, 0, FQ_Background[0], 0, 1, 1, 0xFFFFFFFF);
GRRLIB_DrawImg(0, 0, FQ_Background[1], 0, 1, 1, 0xFFFFFFFF);
int FQ_l;
for (FQ_l = 0; FQ_l <= 100; FQ_l++) {
for (FQ_e = 0; FQ_e < 201; FQ_e++) {
if (objs[FQ_e].active == 1 && objs[FQ_e].depth == FQ_l) {
GRRLIB_DrawImg(objs[FQ_e].x, objs[FQ_e].y, objs[FQ_e].Current_Sprite.spr, 0, 1, 1, 0xFFFFFFFF);
}
}
}
GRRLIB_DrawImg(0, 0, FQ_Background[2], 0, 1, 1, 0xFFFFFFFF);
GRRLIB_DrawImg(0, 0, FQ_Background[3], 0, 1, 1, 0xFFFFFFFF);
GRRLIB_DrawImg(0, 0, FQTRANSO, 0, 1, 1, (fq_red*0x01000000)+(fq_green*0x00010000)+(fq_blue*0x00000100)+(phalpha*0x00000001));
GRRLIB_Render();
phalpha += 2;
}
return 0;
}
int FQ_CreateObject(int fqobjnum, int fqx, int fqy, FQ_WiiSpr fqspr, int obj ,int depth) {
if (objs[fqobjnum].active == 0) {
objs[fqobjnum].active = 1;
objs[fqobjnum].created = 0;
objs[fqobjnum].speed = 0;
objs[fqobjnum].x = fqx;
objs[fqobjnum].y = fqy;
objs[fqobjnum].Current_Sprite = fqspr;
objs[fqobjnum].obj = obj;
objs[fqobjnum].depth = depth;
}
return 0;
}
int FQ_DeleteObject(int objnum) {
objs[objnum].active = 0;
objs[objnum].created = 0;
objs[objnum].dead = 2;
return 0;
}
int FQ_ClearRoom() {
for (FQ_e = 0; FQ_e < 201; FQ_e++) {
objs[FQ_e].active = 0;
objs[FQ_e].created = 0;
objs[FQ_e].dead = 0;
}
FQ_ScreenColor = 0x000000FF;
FQ_fr = 0;
return 0;
}
int FQ_MoveObject(int fqobjnum, int fqx, int fqy, int fqrelative) {
if (fqrelative == 1) {
objs[fqobjnum].x += fqx;
objs[fqobjnum].y += fqy;
} else {
objs[fqobjnum].x = fqx;
objs[fqobjnum].y = fqy;
}
return 0;
}
Please do help it would be very appreciated...