Hi all,

The issue with printf on PIC14 is an old one... You may consider the 
proposal found in
http://simplepic.atspace.com/printf/index.html and possibly 
modify/enhance the code to fit your needs (sprintf)

Daniel


Raphael Neider wrote:

>Hi George,
>  
>
>>I get the following error in all the above case.
>>
>>message: using default linker script
>>"/usr/share/gputils/lkr/16f877.lkr"
>>error: missing definition for symbol "_strlen", required by
>>"modiadc2lcd.o"
>>error: missing definition for symbol "_sprintf", required by
>>"modiadc2lcd.o"
>>    
>>
>
>strlen and sprintf, used in multiply(), are not provided in any of the
>pic14 libraries. You can try to add device/lib/_strlen.c to your
>project, compile it and link against it using
>    sdcc -mpic14 -p16f877 -c _strlen.c
>    sdcc -mpic14 -p16f877 -c modiadc2lcd.c _strlen.o
>
>As for sprintf, including this into the PIC is much more difficult, as
>most of our implementations (device/lib/sprintf.c,
>device/lib/pic16/libc/stdio/sprintf.c) depend on so many other library
>functions (ltoa, ultoa, put_char or __stream_putchar). Again, you may
>try to compile the sources from device/lib/ using the pic14 target, but
>expect this to become... complicated...
>Sorry, I currently do not have the time to dig into this, maybe someone
>has already implemented a (s)printf working with the PIC14 target?
>
>As a workaround for now, you could write an output routine for longs and
>output your float once truncated to the integer part and once, scaled by
>10...00 to output the fractional part.
>
>Regards,
>Raphael
>
>
>
>-------------------------------------------------------------------------
>Using Tomcat but need to do more? Need to support web services, security?
>Get stuff done quickly with pre-integrated technology to make your job easier.
>Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
>http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>_______________________________________________
>Sdcc-user mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/sdcc-user
>  
>


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Sdcc-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to