gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Beginners > Mappy .elf compiling

#9722 - yaustar - Fri Aug 15, 2003 5:08 am

I am having trouble for this little instruction used for Mappy .elf debugging

Quote:

For GCC, you must compile using the "-g" command line switch to generate the necessary DWARF data within the .ELF file.


Where the heck fo I put the -g command?
_________________
[Blog] [Portfolio]

#9726 - jenswa - Fri Aug 15, 2003 11:51 am

Well, how do you compile your things?
Prolly with a line of code, well put -g in front.

But i don't know anything from mappy, so i could be wrong.
But -g in somewhere in your commandline should work.
_________________
It seems this wasn't lost after all.

#9750 - yaustar - Sat Aug 16, 2003 1:18 am

Currently my .bat file is like so:
Code:

path=c:\DevkitAdv\bin
g++ -o main.elf main.cpp
objcopy -O binary main.elf main.bin

pause

but wherever I put the -g bit, I come up with errors, i thought it be here:
Code:

path=c:\DevkitAdv\bin
g++ -o -g main.elf main.cpp
objcopy -O binary main.elf main.bin

pause

or similar...
_________________
[Blog] [Portfolio]

#9751 - tepples - Sat Aug 16, 2003 2:59 am

yaustar wrote:
but wherever I put the -g bit, I come up with errors, i thought it be here:
Code:
g++ -o -g main.elf main.cpp

or similar...

The -o option to g++ is one that takes the immediately following argument. Pretty much the only place you can't put -g is immediately after -o.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#9752 - yaustar - Sat Aug 16, 2003 3:54 am

Great, the one place I didn't put it is BEFORE the -o.
Goddamn.........

For the record, it's working fine now, thanks tepples
_________________
[Blog] [Portfolio]