#6847 - dieudunet - Tue Jun 03, 2003 1:04 pm
I got a C++ error while compiling my code with use of Codewave
using this makefile :
PATH=E:\Data\gba\devkitadv\bin
as start.s -o start.o
gcc -nostartfiles -Wall -mcpu=arm7tdmi -ffreestanding -fomit-frame-pointer -fverbose-asm -fpeephole -Wl,-Map,bin.map,-Ttext=0x08000000,-Tdata=0x03000000 -O3 -o sorcere.elf start.o
sorcere.cpp ./data/module.o ./data/module1.o ./data/menusnd.o ./GBAPlayerGCC.a -lm
objcopy -O binary sorcere.elf sorcere.gba
It do not work , i got this error message about start.o
start.o: In function `data_copy':
start.o(.text+0x114): undefined reference to `PlayerMain'
/cygdrive/d/DOCUME~1/matthieu/LOCALS~1/Temp/ccM4EO4j.o: In function `PlayerMain(
)':
/cygdrive/d/DOCUME~1/matthieu/LOCALS~1/Temp/ccM4EO4j.o(.text+0x69d4): undefined reference to `MP_InitArm(unsigned char)'
/cygdrive/d/DOCUME~1/matthieu/LOCALS~1/Temp/ccM4EO4j.o(.text+0x69e0): undefined
reference to `MP_PlayModuleArm(unsigned char const*, unsigned char)'
/cygdrive/d/DOCUME~1/matthieu/LOCALS~1/Temp/ccM4EO4j.o(.text+0x69e8): undefined
reference to `MP_SetVolumeArm(unsigned char)'
/cygdrive/d/DOCUME~1/matthieu/LOCALS~1/Temp/ccM4EO4j.o: In function `main':
/cygdrive/d/DOCUME~1/matthieu/LOCALS~1/Temp/ccM4EO4j.o(.text+0x6b14): undefined
reference to `MP_InitArm(unsigned char)'
/cygdrive/d/DOCUME~1/matthieu/LOCALS~1/Temp/ccM4EO4j.o(.text+0x6b20): undefined
reference to `MP_PlayModuleArm(unsigned char const*, unsigned char)'
/cygdrive/d/DOCUME~1/matthieu/LOCALS~1/Temp/ccM4EO4j.o(.text+0x6b28): undefined
reference to `MP_SetVolumeArm(unsigned char)'
/cygdrive/d/DOCUME~1/matthieu/LOCALS~1/Temp/ccM4EO4j.o(.text+0x6b48): undefined
reference to `MP_UpdateArm()'
/cygdrive/e/Data/gba/devkitadv/bin/../lib/gcc-lib/arm-agb-elf/3.0.2/libgcc.a(__m
ain.o): In function `__do_global_dtors':
__main.o(.text+0x74): undefined reference to `__EH_FRAME_BEGIN__'
/cygdrive/e/Data/gba/devkitadv/bin/../lib/gcc-lib/arm-agb-elf/3.0.2/libgcc.a(__m
ain.o): In function `__do_global_ctors':
__main.o(.text+0x100): undefined reference to `__EH_FRAME_BEGIN__'
collect2: ld returned 1 exit status
but if i change my code to only use c function ( not c++ ) the compilation work fine.
but my code use a lot of pointer and must be compile as a cpp file.
could someone tell me what i would change to compile my cpp code with this start.o....
thank you
using this makefile :
PATH=E:\Data\gba\devkitadv\bin
as start.s -o start.o
gcc -nostartfiles -Wall -mcpu=arm7tdmi -ffreestanding -fomit-frame-pointer -fverbose-asm -fpeephole -Wl,-Map,bin.map,-Ttext=0x08000000,-Tdata=0x03000000 -O3 -o sorcere.elf start.o
sorcere.cpp ./data/module.o ./data/module1.o ./data/menusnd.o ./GBAPlayerGCC.a -lm
objcopy -O binary sorcere.elf sorcere.gba
It do not work , i got this error message about start.o
start.o: In function `data_copy':
start.o(.text+0x114): undefined reference to `PlayerMain'
/cygdrive/d/DOCUME~1/matthieu/LOCALS~1/Temp/ccM4EO4j.o: In function `PlayerMain(
)':
/cygdrive/d/DOCUME~1/matthieu/LOCALS~1/Temp/ccM4EO4j.o(.text+0x69d4): undefined reference to `MP_InitArm(unsigned char)'
/cygdrive/d/DOCUME~1/matthieu/LOCALS~1/Temp/ccM4EO4j.o(.text+0x69e0): undefined
reference to `MP_PlayModuleArm(unsigned char const*, unsigned char)'
/cygdrive/d/DOCUME~1/matthieu/LOCALS~1/Temp/ccM4EO4j.o(.text+0x69e8): undefined
reference to `MP_SetVolumeArm(unsigned char)'
/cygdrive/d/DOCUME~1/matthieu/LOCALS~1/Temp/ccM4EO4j.o: In function `main':
/cygdrive/d/DOCUME~1/matthieu/LOCALS~1/Temp/ccM4EO4j.o(.text+0x6b14): undefined
reference to `MP_InitArm(unsigned char)'
/cygdrive/d/DOCUME~1/matthieu/LOCALS~1/Temp/ccM4EO4j.o(.text+0x6b20): undefined
reference to `MP_PlayModuleArm(unsigned char const*, unsigned char)'
/cygdrive/d/DOCUME~1/matthieu/LOCALS~1/Temp/ccM4EO4j.o(.text+0x6b28): undefined
reference to `MP_SetVolumeArm(unsigned char)'
/cygdrive/d/DOCUME~1/matthieu/LOCALS~1/Temp/ccM4EO4j.o(.text+0x6b48): undefined
reference to `MP_UpdateArm()'
/cygdrive/e/Data/gba/devkitadv/bin/../lib/gcc-lib/arm-agb-elf/3.0.2/libgcc.a(__m
ain.o): In function `__do_global_dtors':
__main.o(.text+0x74): undefined reference to `__EH_FRAME_BEGIN__'
/cygdrive/e/Data/gba/devkitadv/bin/../lib/gcc-lib/arm-agb-elf/3.0.2/libgcc.a(__m
ain.o): In function `__do_global_ctors':
__main.o(.text+0x100): undefined reference to `__EH_FRAME_BEGIN__'
collect2: ld returned 1 exit status
but if i change my code to only use c function ( not c++ ) the compilation work fine.
but my code use a lot of pointer and must be compile as a cpp file.
could someone tell me what i would change to compile my cpp code with this start.o....
thank you