[En-Nut-Discussion] printf problem
qdg at phas.ubc.ca
qdg at phas.ubc.ca
Sat May 7 01:47:43 CEST 2005
sorry, forgot to attach the thread:
http://www.egnite.de/pipermail/en-nut-discussion/2004-November/003481.html
===================================================================================
Hello Lars,
there will be no separate lib in the future, just libnutcrt.a.
In the current version of the Configurator enabling floating
point support doesn't work. To fix this:
1. Create a file include/cfg/crt.h in your build tree with
the following contents
#ifndef _INCLUDE_CFG_CRT_H_
#define _INCLUDE_CFG_CRT_H_
#ifndef STDIO_FLOATING_POINT
#define STDIO_FLOATING_POINT
#endif
#endif
2. Add
#include <cfg/crt.h>
at the beginning of crt/putf.c and crt/getf.c.
3. Remove the lines
"getff.c",
and
"putff.c",
from conf/crt/crt.nut.
4. Generate the build tree and build Nut/OS.
5. Link your floating point application to libnutcrt.a.
There are simpler ways to do it, but this one will be
compatible to the fixes, which I'm going to commit soon.
Harald
At 20:49 10.11.2004 +0100, you wrote:
>Hi all,
>
>I am qurious if there is a confirmed problem with enabling floating points
>to the file stream using nutconf.exe. I have searched the list and some
>seams to have problems while others don't.
>
>In my case the STDIO_FLOATING_PIONT flag is set in the include/cfg/crt.h
>file created in the build tree, as expected. However, when compiling a
>regular libnutcrt.a file is created instead of the libnutcrtf.a that I
>assumed was to be built. I am using Nut/OS 3.9.2 and updated it with CVS
>version.
>
>Regards,
>/Lars A. Andersson
===================================================================================
> hi,
>
> I shouldve searched through the archives earlier,
> but i found this thread about floats not being enabled,
>
> I tried the solution mentioned in this thread but I would get errors
> during compilation
> such as
>
> C:/ethernut/nutbuild1/lib\libnutcrt.a(vfprintf.o)(.text+0xe):
> In function `vfprintf':
> : undefined reference to `_putf'
>
>
>
>> hi,
>>
>> this is really simple but it seems the printf() in avr libc
>> doesn't recognize %f or %g...
>>
>> with something like
>>
>> printf("the number is %f",myFloat);
>>
>> it would just print the letter 'f'
>>
>> ie:
>>
>> the number is f
>>
>>
>>
>>
>> _______________________________________________
>> En-Nut-Discussion mailing list
>> En-Nut-Discussion at egnite.de
>> http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion
>>
>
> _______________________________________________
> En-Nut-Discussion mailing list
> En-Nut-Discussion at egnite.de
> http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion
>
More information about the En-Nut-Discussion
mailing list