1. The Linker error that I get is: "The target "C:\Develop\Controller.o" is already up to date. Executing: "C:\mcc18\bin\mcc18.exe" -p=18F6720 "graphics.c" -fo="graphics.o" /i"C:\mcc18\h" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- C:\Develop\graphics.c:26:Warning [2058] call of function without prototype C:\Develop\graphics.c:29:Warning [2054] suspicious pointer conversion Executing: "C:\mcc18\bin\mplink.exe" /l"C:\mcc18\lib" "..\..\mcc18\lkr\18f6720.lkr" "C:\Develop\Controller.o" "C:\Develop\graphics.o" /o"CR900Controller.cof" MPLINK 3.20.01, Linker Copyright (c) 2002 Microchip Technology Inc. Error - could not find definition of symbol 'sprintf' in file 'C:\Develop\graphics.o'. Errors : 1 BUILD FAILED" 2. Unfortunately I do need most of the functionalities of the sprintf command. Below is a cut down of what I am trying to achieve, for now. itoa will not be enough for what I need in the long run. int stringLength; char tempChar[20], tempChar[20]; float fullPixelMove = 2.57; sprintf(tempChar,"%.2f", fullPixelMove); stringLength = strlen(tempChar); sprintf(tempChar2,"0.%c%c",tempChar[stringLength-2],tempChar[stringLength-1] ); Regards Richard .O. > -----Original Message----- > From: Richard Osborne [SMTP:richard.osborne@CIRRUSRESEARCH.CO.UK] > Sent: Monday, March 17, 2003 11:51 AM > To: PICLIST@MITVMA.MIT.EDU > Subject: [PIC] Sprintf commands on the C18 compiler > > Hi all > > I am using the PIC18F8720 and need to use the "sprintf" command which is > included in the standard C header file "stdio.h". Unfortunately the > compiler does not recognise the sprintf command and does not allow you to > link the header file without syntax errors. > When you say syntax errors, is the actual linker error something like "undefined symbol"? A few more details on the actual errors and an example of a (small) piece of code that displays the symptoms would help a great deal. > Is it a case that the compiler > has been optimised so much that standard C header files such as stdio does > not work? > Optimisation should have no impact on what library functions you can or cannot use, unless something is badly broken. > To get it to work is there any setup changes needed or is there a > different function that could be used that has all the capabilities of > sprintf? > Do you need to use all the capabilities of sprintf? It's one of a larger library functions and tends to use a significant amount of memory on small devices such as PIC's. You may find some of the simpler functions such as 'itoa' may be suitable for your application. Regards Mike -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu