[Tinyos-help] Re:Build error 1 prinftf

Michael Louie mlouie at measuretek.com
Tue Sep 6 11:57:36 PDT 2005


Hello,Yes, you need to add the "PFLAGS += -Wl,-u,vfprintf -lprintf_flt -lm" line to the MAKEFILE to support "double" data types in the sprintf function, however this will not get rid of the "parse error" caused by the "#include <stdio.h>" statement.

To get rid of the "parse error", move any "#include" statements into a separate "IncludeFiles.h" header file, and use "includes IncludeFiles" instead to call them.

--Mike
> -----Original Message-----
> From: Dangerous Knob [mailto:neilh10tos at biomonitors.com]
> Sent: Thursday, June 30, 2005 8:51 PM
> To: tinyos-help at Millennium.Berkeley.EDU
> Subject: [Tinyos-help] Build error 1 prinftf
> It may depend on which target you are using.
> For the ATMega128 I found this works by adding it to the make file

> PFLAGS += -Wl,-u,vfprintf -lprintf_flt -lm

> I found it in the avr-libc-user-manual-1.2.3.pdf under Standard IO Facilites
> Pg 48
> regards
> Neil


> -----Original Message-----
> From: Dangerous Knob [mailto:jonathan.knoblauch at gmail.com]
> Sent: Thursday, June 30, 2005 7:42 PM
> To: tinyos-help at Millennium.Berkeley.EDU
> Subject: [Tinyos-help] Build error 1 prinftf
> 
> Hi,
> 
> I am trying to use printf statements using #include <stdio.h> in my
> nesc app but I keep getting this compilation error. I cant get rid of
> it. Does anyone know how to use printf statements properly or fix
> this?
> 
> In file included from /usr/local/avr/include/stdio.h:39,
>                  from SendPacket.nc:12:
> /usr/local/lib/gcc-lib/avr/3.3-tinyos/include/stdarg.h:43: parse error
> before `t
> ypedef'
> make: *** [build/mica2/main.exe] Error 1
> 
> Does anyone know how to use printf statements properly or fix this?
> 
> Thanks,
> Jonathan.
> 
> _______________________________________________
> Tinyos-help mailing list
> Tinyos-help at Millennium.Berkeley.EDU
> https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
> 




--------------------------------------------------------------------------------


  a.. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20050906/3ec303fe/attachment.html


More information about the Tinyos-help mailing list