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 > Setting Up DevkitARM

#133831 - biubid_boy - Mon Jul 09, 2007 2:32 am

Hello.
I'm in the process of setting up devkitPro and the Dev-Cpp IDE to work together. But the problem is, whenever I run my makefile (the template makefile from gba examples), I get the following error message.
Quote:
C:\gba_template>make -f makefile
linking multiboot
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.1/../../../../arm-eabi/lib/th
umb/gba_crt0.o: In function `start_vector':
gba_crt0.s:(.init+0x208): undefined reference to `main'
collect2: ld returned 1 exit status
make[1]: *** [/c/gba_template/gba_template_mb.elf] Error 1
make: *** [build] Error 2

This problem doesn't seem to be caused by Dev-Cpp because the same error message appears when I use make from MinGW. Is there something terribly wrong with my installation?
Thanks for any help,
Biubid_boy???

#133890 - gmiller - Mon Jul 09, 2007 3:55 pm

The project is missing a "main" function. I am not sure what you put into the template if anything so the issue at this point is there is no main function. Having never used the template I don't know what the makefile specifies so I am not sure what files the template compiles. Some of the makefiles compile all sources in the "source" folder and then link them together. If that is so then you need to see if any of those source files has a "main" function.

#133893 - wintermute - Mon Jul 09, 2007 4:19 pm

Nothing wrong with your installation, you just haven't told the makefile where the source files actually are. Currently the best way to start a new project is to copy the complete template folder to somewhere else on your drive with the caveat that the new path should not contain spaces. Inside the template folder you'll see another folder called source, inside that are all the source files which belong to the project.

The template makefile will pick up all the .c/.cpp files it finds in that folder and link them into the final binary after compilation.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog