Error using sprintf

Help
2013-10-11
2013-10-11
  • Gustavo Soares Leal

    Hi, I'm using SDCC 2.9.0 to compile a code for a PIC18F4550. I'm trying to use sprintf within my code. I have included the stdlib.h library, but on trying to compile I get the error
    error: missing definition for symbol "_sprintf", required by "build/default/production/_ext/1472/main.o"

    Any tips?

    Thanks.

     
  • Raphael Neider

    Raphael Neider - 2013-10-11

    Did you compile with --use-non-free? If not, please do so.

    Please provide the command line and the output of compilation with -V (or -v? The one that prints how other tools like linker and assembler are invoked).
    You may need to manually link with libc18f.lib - if I am not mistaken, this should be done automatically if you let sdcc invoke the linker.

    Raphael

     
  • Diego Herranz

    Diego Herranz - 2013-10-11

    Given the ammount of newbie problems that are solved using --use-non-free, could SDCC give a warn or hint when compiling for PICs and not using --use-non-free?

     
  • Raphael Neider

    Raphael Neider - 2013-10-11

    That seems like good idea. I will implement such a warning this weekend.

     
  • Diego Herranz

    Diego Herranz - 2013-10-11

    Great! It should solve many trivial problems.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks