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.

C/C++ > linking problem using SGADE and devkitadv r5b3

#22257 - Marill - Wed Jun 16, 2004 6:50 am

SGADE + devkitadv r5b3
CRT0.S : v1.28 Frohwein
linkscript: v1.3 Frohwein
Makefile: September 5, 2002 Jaap Suter, Mark T. Price

bascially followed the tutorial in http://www.suddenpresence.com/bbatutorial/chapter02.html

for the setup.

I've been coding with this setup in pure C with devkitadv r5b3 with absolutley no problems.

The problems come when I decided I need to go C++ in order to better manage my larger coding project. (this is not a C++ > C thing, it's just that personally I am more comfortable with OOP with larger projects)

So I've followed the tutorial in http://www.suddenpresence.com/bbatutorial/chapter02.html

bottom section titled "Additions for C++ support "

It compiles nicely, but the error comes during the object linking

Code:

Linking object files
C:\devkitadv-r5-beta-3\bin\ld.exe: section .data [02013a88 -> 02013adf] overlaps section .dtors [02013a88 -> 02013a8f]
make: *** [C:/gba/demogame2/bin/demogame2.elf] Error 1


I've read that there are some changes to the new devkitadv r5b3 from the old one devkitadv4 that could be the cause of the problems. The tutorial at the SGADE site is using version 4 of devkitadv.

So, I have installed version 4 of the devkitadv and I tried the compiling and linking again.

Compilation works fine. But during linking I get these errors

Code:

Linking object files
C:/devkitadv/lib/gcc-lib/arm-agb-elf/3.0.2/interwork/libgcc.a(__main.o): In function `__do_global_ctors':
__main.o(.text+0xd0): undefined reference to `atexit'
C:/devkitadv/lib/gcc-lib/arm-agb-elf/3.0.2/interwork/libgcc.a(unwind-dw2-fde.o):
 In function `size_of_encoded_value':
unwind-dw2-fde.o(.text+0x60): undefined reference to `abort'
C:/devkitadv/lib/gcc-lib/arm-agb-elf/3.0.2/interwork/libgcc.a(unwind-dw2-fde.o):
 In function `read_encoded_value_with_base':
unwind-dw2-fde.o(.text+0x1e0): undefined reference to `abort'
C:/devkitadv/lib/gcc-lib/arm-agb-elf/3.0.2/interwork/libgcc.a(unwind-dw2-fde.o):
 In function `__register_frame':
unwind-dw2-fde.o(.text+0x284): undefined reference to `malloc'
C:/devkitadv/lib/gcc-lib/arm-agb-elf/3.0.2/interwork/libgcc.a(unwind-dw2-fde.o):
 In function `__register_frame_table':
unwind-dw2-fde.o(.text+0x348): undefined reference to `malloc'
C:/devkitadv/lib/gcc-lib/arm-agb-elf/3.0.2/interwork/libgcc.a(unwind-dw2-fde.o):
 In function `__deregister_frame_info_bases':
unwind-dw2-fde.o(.text+0x404): undefined reference to `free'
unwind-dw2-fde.o(.text+0x440): undefined reference to `abort'
C:/devkitadv/lib/gcc-lib/arm-agb-elf/3.0.2/interwork/libgcc.a(unwind-dw2-fde.o):
 In function `__deregister_frame':
unwind-dw2-fde.o(.text+0x478): undefined reference to `free'
C:/devkitadv/lib/gcc-lib/arm-agb-elf/3.0.2/interwork/libgcc.a(unwind-dw2-fde.o):
 In function `base_from_object':
unwind-dw2-fde.o(.text+0x4f0): undefined reference to `abort'
C:/devkitadv/lib/gcc-lib/arm-agb-elf/3.0.2/interwork/libgcc.a(unwind-dw2-fde.o):
 In function `get_cie_encoding':
unwind-dw2-fde.o(.text+0x528): undefined reference to `strlen'
C:/devkitadv/lib/gcc-lib/arm-agb-elf/3.0.2/interwork/libgcc.a(unwind-dw2-fde.o):
 In function `start_fde_sort':
unwind-dw2-fde.o(.text+0x12ec): undefined reference to `malloc'
unwind-dw2-fde.o(.text+0x1310): undefined reference to `malloc'
C:/devkitadv/lib/gcc-lib/arm-agb-elf/3.0.2/interwork/libgcc.a(unwind-dw2-fde.o):
 In function `end_fde_sort':
unwind-dw2-fde.o(.text+0x13cc): undefined reference to `free'
unwind-dw2-fde.o(.text+0x140c): undefined reference to `abort'
unwind-dw2-fde.o(.text+0x1410): undefined reference to `abort'
make: *** [C:/gba/demogame2/bin/demogame2.elf] Error 1



Anyone who has any idea what is going wrong, please help! Thanks in advance, I've been tearing my hair out trying to figure it out on my own!

thanks!

#22267 - Abscissa - Wed Jun 16, 2004 3:34 pm

You know, I've been having pretty much the same problem.

crt0.S v1.26 by Jeff Frohwein
Makefile: 01/06/2002 Author: Benjamin D. Hale Orignally by: Jaap Suter Contributed to by: Christer Andersson
(Makefile came with GBA Project AppWizard v2.6)
DevKitAdvance R4

The error I've been getting when trying to use C++ is

Quote:

C:\DevKitAdv\lib\gcc-lib\arm-agb-elf\3.0.2\interwork/libgcc.a(__main.o): In function `__do_global_dtors':
__main.o(.text+0x80): undefined reference to `__EH_FRAME_BEGIN__'
C:\DevKitAdv\lib\gcc-lib\arm-agb-elf\3.0.2\interwork/libgcc.a(__main.o): In function `__do_global_ctors':
__main.o(.text+0x114): undefined reference to `__EH_FRAME_BEGIN__'
NMAKE : fatal error U1077: 'C:\DevKitAdv\bin\ld' : return code '0x1'


Pretty cryptic

#36565 - jeremy whiting - Thu Feb 24, 2005 7:27 pm

anyone figure out how to solve this yet? I just came across the same problem after converting all my code to c++ as well.

I'm using devkitadvance on linux that has arm-agb-elf-g++ 3.1 and Jeff's 1.28 crt0.s

#36574 - wintermute - Thu Feb 24, 2005 9:47 pm

why is anyone still using devkitadvance?

http://sourceforge.net/projects/devkitpro

#36576 - Kyoufu Kawa - Thu Feb 24, 2005 9:53 pm

Beats me. I'd use DevKitArm, if I didn't already use ProDG.

#36579 - MumblyJoe - Fri Feb 25, 2005 12:43 am

I guess a lot of the old tutorials still say to use devkitadv or something.
_________________
www.hungrydeveloper.com
Version 2.0 now up - guaranteed at least 100% more pleasing!