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.

Coding > CodeWave linking error

#10274 - dieudunet - Mon Sep 01, 2003 10:12 am

see this ;

E:\Devel\music\GBA_MusicWave12\SDKDsitribution\GCCDemoThumb>PATH=E:\devel\devkit
adv\bin

E:\Devel\music\GBA_MusicWave12\SDKDsitribution\GCCDemoThumb>as -mthumb-interwork
start.s -o start.o

E:\Devel\music\GBA_MusicWave12\SDKDsitribution\GCCDemoThumb>gcc -mcaller-super-i
nterworking -ffreestanding -fomit-frame-pointer -fverbose-asm -nostartfiles -mth
umb -mthumb-interwork -Wall -mcpu=arm7tdmi -Wl,-Map,bin.map,-Ttext=0x08000000,-T
data=0x03000000 -O3 -o GBAPlayer.elf start.o main.cpp ../data/module.o ../data/m
odule1.o ../data/menusnd.o ../GBAPlayerGCC.a
/cygdrive/e/devel/devkitadv/bin/../lib/gcc-lib/arm-agb-elf/3.0.2/../../../../arm
-agb-elf/bin/ld: Warning: ../data/module.o does not support interworking, wherea
s GBAPlayer.elf does
/cygdrive/e/devel/devkitadv/bin/../lib/gcc-lib/arm-agb-elf/3.0.2/../../../../arm
-agb-elf/bin/ld: Warning: ../data/module1.o does not support interworking, where
as GBAPlayer.elf does
/cygdrive/e/devel/devkitadv/bin/../lib/gcc-lib/arm-agb-elf/3.0.2/../../../../arm
-agb-elf/bin/ld: Warning: ../data/menusnd.o does not support interworking, where
as GBAPlayer.elf does
start.o: In function `jump_intr':
start.o(.text+0x230): undefined reference to `PlayerMain'
collect2: ld returned 1 exit status

I think that the problem it's that i use g++ ( because it's a CPP code )
i have a function name int PlayerMain(void) in my code but it do not seems to find it... how can i do ?

I use the CodeWave head file between a #include "C" form but it do not change a things.... please help..

#10284 - tepples - Mon Sep 01, 2003 4:38 pm

If PlayerMain() has to be a C function, then you need to put extern "C" { } around its prototype.

To solve the interwork problems, compile your other modules with -mthumb-interwork.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.