Menu

help! missing definition for symbol _strcpy

Help
2009-04-11
2013-03-12
  • Levent Biyikoglu

    Please help me, I'm new to SDCC and when I compile the first test program test.c for PIC 16f628a I get this error during linking:

    error: missing definition for symbol "_strcpy", required by "test.o"

    sdcc -S -V -mpic14 -p16f628a -D__16f628a test.c  compiles without any error
    gpasm -c test.asm produces test.o without any error

    gplink -m -s /usr/local/share/gputils/lkr/16f628a.lkr -o output.hex /usr/local/share/sdcc/lib/pic/pic16f628a.lib /usr/local/share/sdcc/lib/pic/libsdcc.lib test.o

    this outputs:
    warning: processor mismatch in "idata.o"
    warning: processor mismatch in "_gptrget1.o"
    warning: processor mismatch in "_gptrget2.o"
    error: missing definition for symbol "_strcpy", required by "test.o"

    What's wrong? I could not figure out...

    Thanks

     
    • Raphael Neider

      Raphael Neider - 2009-04-11

      Well, there seems to be a reference to strcpy() in your code, but none of the linked libraries and .o files provides a definition for it.
      This is a consequence of the pic14 libraries being non-existant: apart from the sdcc support routines (generic pointers, float arithmetics, initialization) there is nothing, especially no libc.
      You can grab the relevant sources from the sdcc/device/lib/pic16/libc or sdcc/device/lib/ (from the source distribution of sdcc or better yet, an svn checkout) and add them to your project --- or reipmplement the routines you need.

      Best regards,
      Raphael

       
    • tymop

      tymop - 2009-04-25

      you maybe have the same problem than me (resolved):
      https://sourceforge.net/forum/forum.php?thread_id=3120750&forum_id=1865

       

Log in to post a comment.