Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

PIC16 linker problem

2009-05-31
2013-03-12
  • Benjamin Linus
    Benjamin Linus
    2009-05-31

    Hi all,

    I`m trying to compile the pic16F916 but it has a strange problem when it calls the linker.

    1) with this compilation command, without specifying the lkr file, it calls the default linker:

    C:\>sdcc -mpic16 --out-fmt-ihx test.c
    message: using default linker script "C:\Program Files\gputils\lkr\18f452.lkr"

    It`s ok.

    2) if I try to specify a lkr file, it doesn`t accept and calls the default:

    C:\>sdcc -mpic16 -l 16f916.lkr --out-fmt-ihx test.c
    error: "C:\Program Files\gputils\lkr\16f916.lkr" is not a valid coff object or archive
    message: using default linker script "C:\Program Files\gputils\lkr\18f452.lkr"

    I can`t realize where is the error, because the file 16f916.lkr exists in the folder.

    3) Now is the problem, if i specify the default lkr file, it shows the error message but calls it:

    C:\>sdcc -mpic16 -l 18f452.lkr test.c
    error: "C:\Program Files\gputils\lkr\18f452.lkr" is not a valid coff object or archive
    message: using default linker script "C:\Program Files\gputils\lkr\18f452.lkr"

    So, if have any on what`s happening here, please give me this help.

    Thanks in advance.

     
    • Mark Bryars
      Mark Bryars
      2009-07-10

      -l is for specifying libraries

      sdcc -mpic16 -Wl-s16f916.lkr --out-fmt-ihx test.c