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 > gba with Devkitpro (compiling a project from scratch)

#176772 - blessingta@hotmail.co.uk - Sun Oct 09, 2011 1:08 am

hi

hi
I tried to make a devkitpro project from scratch to see whether it would compile. And the tactic I use was copying working components from the gba examples provide, which worked well till I got to the makefile (which I largely copied: the only changes made were including my new folders and removing those which weren't present in my project).

My main problem is the linker error, the so called 'linking multiboot', according to the compiler. I don't really understand this error since I had thought that there wouldn't be any special links needed since I would have been using largely the same files (the devkitpro gba lib files). So has anyone understood how devkitpro works with regards to makefiles and creating new projects

<message in blue below>

Quote:
> "make"

linking cartridge

c:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.6.1/../../../../arm-eabi/lib/thumb/gba_crt0.o: In function `CIDExit':

(.init+0x20c): undefined reference to `main'

collect2: ld returned 1 exit status

make[1]: *** [/c/users/portsmouthuni/my_gba/my_gba.elf] Error 1

"make": *** [build] Error 2

> Process Exit Code: 2

> Time Taken: 00:01

#176774 - Dwedit - Sun Oct 09, 2011 4:44 am

blessingta@hotmail.co.uk wrote:

(.init+0x20c): undefined reference to `main'


It means you have no main() function. You need one, because that's the entry point, it's what runs first.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#176777 - blessingta@hotmail.co.uk - Mon Oct 10, 2011 5:52 pm

Dwedit wrote:
blessingta@hotmail.co.uk wrote:

(.init+0x20c): undefined reference to `main'


It means you have no main() function. You need one, because that's the entry point, it's what runs first.


but my int main function is declared, which makes it quite strange. Plus with the make file I was largely copying and trying make changes were it seems to make sense (mainly with my include folder), but otherwise my make file was just copying and pasting

#176779 - blessingta@hotmail.co.uk - Mon Oct 10, 2011 6:38 pm

its ok its fixed