#32080 - Demon_knight - Sat Dec 18, 2004 1:25 am
Im having a problem.When i try to compile the code,it says this
C:\devkitadv\Pong\objcopy -O Binary pong.elf pong.bin
/cygdrive/c/DEVKIT~1/BIN/OBJCOPY: pong.elf: No Such File Or Directory.
And I know what The Prob is.
Its Cant find the Pong.elf
But my question is,is if it cant find it,then how is it created?
Im following the tutorial on this site.
http://www.webbesen.dk/gba/
by the way,this is the code i am using
path=C:\devkitadv\bin
gcc -o pong.elf pong.c -lm
objcopy -O binary pong.elf pong.bin
Sorry guys, im new to this whole GBA game making scene
#32084 - DiscoStew - Sat Dec 18, 2004 1:42 am
There is obviously a fix for this, but instead, I want to introduce you to a different compiler, which is DevKitARM. The community here has been transitioning to this compiler for many reasons, with one major reason being that DevKitAdv is no longer being updated. Even though this compiler doesn't seem to be updated either, it is still newer than DevKitAdv. With a good makefile, you really won't have problems compiling your projects.
_________________
DS - It's all about DiscoStew
#32085 - Demon_knight - Sat Dec 18, 2004 1:45 am
Thx man,lol,i have made very little progress in this 15min time span.
#32094 - Demon_knight - Sat Dec 18, 2004 3:25 am
AHH,NOW IM GETTIN ANGRY. IM FOLLOWING THIS TUTORIAL THE WAY IT SAYS AND ITS STILL NOT WORKING.IM STILL HAVING THE Stupid ELF File problem
this is the code im using.
#include "gba.h"
#include "bg.h"
int main() {
u16 loop;
SetMode(MODE_4 | BG2_ENABLE);
for (loop = 0; loop < 256; loop++) {
BG_PaletteMem[loop]=bgPalette[loop];
}
for (loop = 0; loop < (120*160); loop++) {
FrontBuffer[loop] = bgData[loop] ;
}
return 0;
}
and this is the error i get.
C:\devkitARM_r8\pong>PATH=C:\devkitARM_r8\bin;C:\WINDOWS;C:\WINDOWS\COMMAND
C:\devkitARM_r8\pong>arm-elf-gcc -mthumb-interwork -O2 -g0 -specs=gba.specs -o p
ong.elf pong.c
pong.c: In function `main':
pong.c(11): error: `bgPalette' undeclared (first use in this function)
pong.c(11): error: (Each undeclared identifier is reported only once
pong.c(11): error: for each function it appears in.)
pong.c(15): error: `bgData' undeclared (first use in this function)
C:\devkitARM_r8\pong>arm-elf-objcopy -O binary pong.elf pong.gba
C:\DEVKIT~1\BIN\ARM-E~12.EXE: 'pong.elf': No such file
C:\devkitARM_r8\pong>del pong.elf
File not found
C:\devkitARM_r8\pong>pause
Press any key to continue . . .
this is the make.BAT code im using.
PATH=C:\devkitARM_r8\bin;%PATH%
arm-elf-gcc -mthumb-interwork -O2 -g0 -specs=gba.specs -o pong.elf pong.c
arm-elf-objcopy -O binary pong.elf pong.gba
del pong.elf
pause
oh by the way,im using the DevKitARM_R8
#32108 - Krakken - Sat Dec 18, 2004 4:57 am
Just so you know, an ELF is generated when the files are compiled and linked. Your getting errors and you need to fix those first. After that it should compile.
#32111 - Demon_knight - Sat Dec 18, 2004 5:23 am
I dont get it,Does it Look Like there is a error in this code that matches the prob at the bottom?
#include "gba.h"
#include "bg.h"
int main() {
u16 loop;
SetMode(MODE_4 | BG2_ENABLE);
for (loop = 0; loop < 256; loop++) {
BG_PaletteMem[loop]=bgPalette[loop];
}
for (loop = 0; loop < (120*160); loop++) {
FrontBuffer[loop] = bgData[loop] ;
}
return 0;
}
this is the error message im getting
C:\devkitARM_r8\pong>arm-elf-gcc -mthumb-interwork -O2 -g0 -specs=gba.specs -o p
ong.elf pong.c
pong.c: In function `main':
pong.c(11): error: `bgPalette' undeclared (first use in this function)
pong.c(11): error: (Each undeclared identifier is reported only once
pong.c(11): error: for each function it appears in.)
pong.c(15): error: `bgData' undeclared (first use in this function)
C:\devkitARM_r8\pong>arm-elf-objcopy -O binary pong.elf pong.gba
C:\DEVKIT~1\BIN\ARM-E~12.EXE: 'pong.elf': No such file
C:\devkitARM_r8\pong>del pong.elf
File not found
#32112 - sgeos - Sat Dec 18, 2004 5:32 am
Code: |
pong.c: In function `main': |
In the main function... (in pong.c)
on line 11 of pong.c...
Code: |
`bgPalette' undeclared |
bgPalette is used before it has been declared.
Code: |
pong.c(15): error: `bgData' undeclared |
bgData is also used befor it has been declared. (line 15 of pong.c)
Declare them before you use them and this problem will be solved.
NOTE: I didn't pay attention to any other problems there may have been, because these struck me as the most critical.
-Brendan
#32113 - Demon_knight - Sat Dec 18, 2004 5:34 am
#define BG_WIDTH 240
#define BG_HEIGHT 160
const u16 BGData[] = {where the bg code is,};
const u16 BGPalette[] = {where the bg code is,};
#32114 - sgeos - Sat Dec 18, 2004 5:40 am
What file are those declared in? Are you including it in your build?
Code: |
gcc -Wall -o foobar.elf foo.c bar.c |
-Brendan
#32115 - isildur - Sat Dec 18, 2004 5:40 am
The C language is case sensitive. bgPalette is defined as BGPalette...
I suggest you learn C before digging into gba coding cause there are more difficult stuff ahead...
#32117 - Demon_knight - Sat Dec 18, 2004 5:45 am
Thx,Guys,I got it to work,This Dudes Scripts are messed up.
#32140 - blinky465 - Sat Dec 18, 2004 11:18 am
Demon_knight wrote: |
This Dudes Scripts are messed up. |
I know how difficult it is, to try to learn from dodgy code.
I think that most people find a good way to learn is to try someone else's (working) code and tweaking it, a bit at a time, to get it to do something interesting. If the code you're learning from doesn't work, you're in for a tough time!
But you could do with learning the C language a little more in depth (not so that you know every command off-by-heart, but enough to recognise simple errors yourself). This way, you'll be able to tell whether the code you're learning from is any good, and whether any errors you introduce into the code yourself are simple syntax errrors, or something more substantial.
#32177 - Issac - Sun Dec 19, 2004 1:34 am
HEY HEY!
Quote: |
,This Dudes Scripts are messed up. |
It is NOT messed up.. its the best tutorial out there in my opinion.
and the scripts are NOT messed up...
I havn't got a single problem...
I'd say you havn't installed the DevKitAdv in the root of C:\
or changed something... thats why it wouldnt work...
if you follow it EXACTLY.. or know what changes to do (if you have another directory or something.. like installing devkitadv on D:\ and change the name to gbac++ itd be:
path=D:\gbac++\bin
gcc -o pong.elf pong.c -lm
objcopy -O binary pong.elf pong.bin
I HATE it when ppl blame others for their own lack of knowledge....
Im sorry if this is mean.... mod... change it if you want.... but i get so mad!
_________________
yeah, well, maybe... or? anyways.... eh... what was i talking about??
#32183 - sgeos - Sun Dec 19, 2004 3:08 am
Demon_knight wrote: |
Thx,Guys,I got it to work,This Dudes Scripts are messed up. |
I don't see any scripts. Only source code. There is a difference.
-Brendan