#14466 - blender - Wed Jan 07, 2004 4:38 am
Hi,
I'm using the GNU/Linux Debian woody 3.0,and i download the new devkitadv from the
www.sourceforge.net.
I installed it and add the PATH/LIBRARY_PATH/C_INCLUDE_PATH to my .profile file.
When i use this command to compile a agb source,it says:
$arm-agb-elf-cpp -lm -o main.elf main.c
arm-agb-elf-cpp: -lm: linker input file unesed because linking not done
I followed the tutorial and used the sample source.What can i do now?
thanks.
#14476 - tepples - Wed Jan 07, 2004 5:45 am
"cpp" is the C preprocessor, which processes '#include', '#define', and '#if'.
What you want to run instead is 'arm-agb-elf-g++'.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#14484 - blender - Wed Jan 07, 2004 9:25 am
Thank you very much.
When i run the arm-agb-elf-gcc it says:
16:26:48<src>$arm-agb-elf-gcc -lm -o main.elf main.c
/home/long/apps/devel/devkitadv/bin/../lib/gcc-lib/arm-agb-elf/3.1/../../../../arm-agb-elf/bin/ld: section .iwram [08009cd4 -> 08009d9b] overlaps section .rodata [080004f4 -> 08009cf3]
/home/long/apps/devel/devkitadv/bin/../lib/gcc-lib/arm-agb-elf/3.1/../../../../arm-agb-elf/lib/crt0.o: In function `jump_intr':
/home/long/apps/devel/devkitadv/bin/../lib/gcc-lib/arm-agb-elf/3.1/../../../../arm-agb-elf/lib/crt0.o(.iwram+0xc4): undefined reference to `IntrTable'
collect2: ld returned 1 exit status
I think it's a linker problem.
#14497 - poslundc - Wed Jan 07, 2004 5:02 pm
It is a linker problem. Are you using the correct linkscript? I'm not sure what else could be causing the first error.
The second error looks like it is because you have interrupts turned on in crt0.S without supporting them in your code.
Dan.
#14536 - blender - Thu Jan 08, 2004 2:43 am
Hmm,i think i use the correct lnkscript.It is downloaded from the www.devrs.org.
I have read the FAQ and some turtials.
Thank you for your help
#14551 - Torlus - Thu Jan 08, 2004 10:00 am
Well, I think you should try something like :
gcc -nostartfiles -o main.elf crt0.o main.o -lm -Wl,-Tlnkscript
"-Wl" is used to pass arguments to the linker.
"-Tlnkscript" tells the linker to actually use the lnkscript.
"-nostartfiles" ensures that you're using the right crt0 :)
Hope this helps
_________________
GBA,GC,NGPC,GP32,FPGA,DS stuff at http://torlus.com/
#14552 - blender - Thu Jan 08, 2004 12:47 pm
Thanks for all.
Now, I'm very glad to compiler my GBA program.
Thanks.