how to compile source with library?

Help
pou
2010-11-11
2013-03-12
  • pou
    pou
    2010-11-11

    Hello,
    I try compile this code:

    #include <pic16f628a.h>
    #include <string.h>
    void main() {
    char str1;
    strcpy(str1,"ahoj");
    for(;;){}
    }

    But compiler/linker report error:
    $sdcc -debug -mpic14 -p16f628a  funkce1.c 
    message: using default linker script "/usr/share/gputils/lkr/16f628a.lkr"
    error: missing definition for symbol "_strcpy", required by "funkce1.o"

    Can somebody help me??  It's important for me.
    Thank

     
  • Raphael Neider
    Raphael Neider
    2010-11-11

    There is no readily built libc available for the 14-bit PICs in SDCC. You can grab the SDCC source code and use the library sources found in device/lib/ to obtain implementations of (some of the) libc functions and add them directly to your project.