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.

Audio > codewave linking error

#10275 - dieudunet - Mon Sep 01, 2003 11:02 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..

#10705 - sajiimori - Sat Sep 13, 2003 1:24 am

#include "C" is incorrect. You are probably thinking of:
Code:

extern "C"
{
    int PlayerMain(void) { ... }
}