#3777 - I.C.E - Sat Mar 08, 2003 7:14 pm
Hello,
I encounter the following error messages if i use floating points:
undefined reference to `__floatsisf'
undefined reference to `__divsf3'
undefined reference to `__addsf3'
undefined reference to `__fixsfsi'
If i use a optimizing switch like -O3 i get a message that memcpy is undefined. I guess it has something to do with copying a structure to the called function.
I have tried linking with libgcc.a, libc.a, libm.a, libg.a but nothing helped to get it working. Any ideas? Are the undefined references not in the above mention libraries?
_________________
To this day, many C programmers believe that "strong typing" just means pounding extra hard on the keyboard.
- Peter van der Linden
#3790 - tepples - Sun Mar 09, 2003 1:01 am
First of all: Don't use floating-point math in production GBA code because the ARM7TDMI lacks a floating-point unit. In fact, I usually integerize my algorithms while they're still in PC-based unit testing.
Second, if you're linking two or more of libm, libc, or libgcc, you have to specify them in just that order. Functions in libraries can call functions in other libraries only if the caller precedes the callee in link order. Libm calls functions in libc, which in turn calls functions in libgcc. Thus, you should -lm -lc -lgcc in that order.
If you're linking with 'gcc' rather than 'ld', gcc will handle insert -lc -lgcc for you.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#3808 - I.C.E - Sun Mar 09, 2003 4:35 pm
Thanks,
but I am linking already in that way.
Here the command i use through Makefile:
arm-agb-elf-ld -lm -lc -lgcc -T lnkscript crt0.o -o outfile <objectfiles>
My object files are compiled with
arm-agb-elf-gcc -Wall -g -mthumb-interwork -c -o
Is it possible that my supplied libgcc.a are not correct? How can I check if __floatsisf are supplied by this libraries and if not how to create a correct one? By the way, I am using Linux Devkitadvance: http://www.doc.ic.ac.uk/~tb100/?devkit=1
_________________
To this day, many C programmers believe that "strong typing" just means pounding extra hard on the keyboard.
- Peter van der Linden
#3811 - Paul Shirley - Sun Mar 09, 2003 5:28 pm
removed
Last edited by Paul Shirley on Sun Mar 28, 2004 9:50 pm; edited 1 time in total
#3814 - I.C.E - Sun Mar 09, 2003 5:57 pm
I finaly found the problem. You have to add the c library after your own object files.
arm-agb-elf-ld -T lnkscript crt0.o -o outfile <objectfiles> -lm -lc -lgcc
works.
The only problem I have now is that It seems that my program crashes. I guess it has something to do with the message:
arm-agb-elf-ld: Warning: /opt/devkitadv/arm-agb-elf/lib/libc.a(memcpy.o) does not support interworking, whereas file.out does.
Any ideas how to solve it?
_________________
To this day, many C programmers believe that "strong typing" just means pounding extra hard on the keyboard.
- Peter van der Linden
#3816 - I.C.E - Sun Mar 09, 2003 6:19 pm
Forget about my interwork question. I have found the thumb-interwork version of the libraries. By the way it is interesting to see that my game runs now signifcant slower and does not work as expected anymore. I guess I really should omit the libraries.
_________________
To this day, many C programmers believe that "strong typing" just means pounding extra hard on the keyboard.
- Peter van der Linden
#3822 - Paul Shirley - Mon Mar 10, 2003 12:27 am
removed
Last edited by Paul Shirley on Sun Mar 28, 2004 9:51 pm; edited 1 time in total
#3853 - I.C.E - Mon Mar 10, 2003 9:26 pm
I have many .c files to compile for my project and it took quite a long time to compile them. Often I don't need to compile every file, just one. If gcc setups the linker I have to compile the whole project if I make a small change, or am i wrong?
_________________
To this day, many C programmers believe that "strong typing" just means pounding extra hard on the keyboard.
- Peter van der Linden
#3859 - Paul Shirley - Mon Mar 10, 2003 10:40 pm
removed
Last edited by Paul Shirley on Sun Mar 28, 2004 9:52 pm; edited 1 time in total
#3863 - pelrun - Tue Mar 11, 2003 3:04 am
Paul Shirley wrote: |
From my Spindizzy makefile |
Augh! You mean I've been busily reverse engineering the original CPC Spindizzy these past three months for nothing? Noooo! :)
Actually, it's been a *lot* of fun figuring it out (at least it's easier for me than completing the game!) - I'll keep going if only because I've got nothing better to do at work during downtime.
And whenever the new Spindizzy is coming out, you know I'll be first in line to get it...
#3864 - Paul Shirley - Tue Mar 11, 2003 3:28 am
removed
Last edited by Paul Shirley on Sun Mar 28, 2004 9:52 pm; edited 1 time in total
#3869 - Quirky - Tue Mar 11, 2003 8:44 am
Paul Shirley wrote: |
FYI its Spindizzy Worlds, the bigger, faster, prettier Amiga version that Activision buried from sight. |
So it isn't a port of the SNES version then? ;-)))
*runs off and hides*
#3873 - pelrun - Tue Mar 11, 2003 12:15 pm
Paul Shirley wrote: |
Unless publishers stop ignoring their phones you could be waiting a while ;( |
Oh well. Hey, I'm patient. Shame on you, publishers!
Paul Shirley wrote: |
FYI its Spindizzy Worlds, the bigger, faster, prettier Amiga version that Activision buried from sight. I have no intention of reviving the 8 bit game so you might as well continue cloning! |
I figured that was the case - like you said, SW is bigger, faster *and* prettier :) Though there is something to be said for the nice clean angular look of the original Hangworld...
Woo! Official blessing! Then again, now I'm honour bound to actually produce something... damn. ;)