#10004 - cesium - Sun Aug 24, 2003 5:07 pm
I need to convert a float to an ascii string with DevKitAdv R4.
If you know a way to do this, please post.
I am trying to use the fcvtbuf function.
I included the stdlib.h header.
My code compiled just fine.
But at link time... (barf!)
C:\GBA\devkitadv\arm-agb-elf\lib\interwork/libc.a(ecvtbuf.o): In function `_gcvt':
../../../../../../gcc-3.0.2/newlib/libc/stdlib/ecvtbuf.c:350: undefined reference to `__eqdf2'
../../../../../../gcc-3.0.2/newlib/libc/stdlib/ecvtbuf.c:361: undefined reference to `__ledf2'
../../../../../../gcc-3.0.2/newlib/libc/stdlib/ecvtbuf.c:347: undefined reference to `__negdf2'
my make file linker cmd is:
ld $(LDFLAGS) -o WinWork1.elf $(O_FILES) -lm -lstdc++ -lgcc -lc
Did I leave out something? I tried including a bunch of other
libs...no joy. Any ideas?
Thanks!
cesium
#10010 - Lupin - Sun Aug 24, 2003 5:59 pm
yeah, I had the same problem some time ago... I moved over to ARM ADS though, it's much easier.
Why do you want to convert an float to an ascii char? This doesn't make any sense to me
#10014 - tepples - Sun Aug 24, 2003 7:07 pm
cesium wrote: |
ld $(LDFLAGS) -o WinWork1.elf $(O_FILES) -lm -lstdc++ -lgcc -lc |
You usually need another -lgcc after -lc.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#10023 - cesium - Sun Aug 24, 2003 9:55 pm
Lupin, thanks for the reply. I'll look at the ARM ADS. Do we just use
our usual crtbegin and end with it? Is it tough to get it up and running
for the GBA?
Also, Lupin, I'm trying to produce an ASCII string that is a representation
of the value of a float (not a single char).
Tepples, thank you for the help. I added a -lgcc after my -lc and
everything linked OK!!! I'm going to test the functionality now...
I've read some of your help docs before, good work.
Thanks all,
cesium
#10024 - cesium - Sun Aug 24, 2003 10:17 pm
Yup! It works!
Thanks again,
cesium
#10029 - tom - Sun Aug 24, 2003 10:53 pm
why don't you simply do the linking step via the gcc frontend and let it sort everything out by itself ?
#10037 - Gordon - Mon Aug 25, 2003 4:38 am
tom wrote: |
why don't you simply do the linking step via the gcc frontend and let it sort everything out by itself ? |
#10039 - tom - Mon Aug 25, 2003 10:09 am
: What is the GCC frontend?
it's the program called gcc. this is not the compiler itself, just a frontend which, depending on the type of input files (and command line switches), calls the real compiler, as, ld, the preprocessor only...
it can make your life easier, since for example it knows which libraries to link to and in which order to throw them at the linker.
oh yes...if you're linking c++ programs you should use g++ instead of gcc, as gcc doesn't supply the -lstdc++ to ld, only g++ does that (i think).
#10042 - Lupin - Mon Aug 25, 2003 2:09 pm
I think it's better to have control about the compile process (even though I don't know how to use this "control" :D), so letting gcc link everything is not the way I would compile my project.
cesium: ARM ADS doesn't need an crtbegin.o and crtend.o, but it still needs the start file of course, the compiler works for every arm cpu and it's not specifically for gba programming, but it includes an very good emulator/debugger wich you could use to execute your code step by step and check the values of each register/variable in code (the debugger doesn't support swi calls though, wich is an real drawback for me :()
#10045 - tom - Mon Aug 25, 2003 2:42 pm
Lupin wrote: |
I think it's better to have control about the compile process (even though I don't know how to use this "control" :D)
|
pff...that's the point - if you don't know how to do it, let gcc mess with ld and you'll be fine :P
#10142 - cesium - Wed Aug 27, 2003 10:23 pm
I am soooo clueless when it comes to make files.
Tom, can you suggest a resource that I can read to
learn more about the use of gcc and ld (and g++) in
the context of a make file?
cesium
#10151 - tom - Thu Aug 28, 2003 11:06 am
cesium:
gnu documentation comes to mind. at least that's what i use.
http://www.gnu.org/manual/manual.html
(often this are not only reference manuals, but real books including tutorials, like the manuals for flex and bison)
#10170 - cesium - Thu Aug 28, 2003 9:43 pm
thx
Cs