> I get the following error in all the above case.
> message: using default linker script
> error: missing definition for symbol "_strlen", required by
> error: missing definition for symbol "_sprintf", required by
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.