Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

How to use gplink (No such file or directory)

Help
aozima
2009-03-09
2013-03-12
  • aozima
    aozima
    2009-03-09

    I have used SDCC for MCS-51
    Today !
    I wan't to try PIC16F877A

    command:(use IDE Codeblocks)
    sdcc --out-fmt-ihx -mpic14 -p16f877a -c led.c -o led.rel
    sdcc --out-fmt-ihx -mpic14 -p16f877a -c main.c -o main.rel
    sdcc -o main.hex --out-fmt-ihx  -mpic14 -p16f877a led.rel main.rel

    OK! Success Download the main.hex ,The LED is dodging...

    but ! I wan't write a Makefile
    Reference sdccman.pdf page 63

    command:
    sdcc  -mpic14 -p16f877a -c main.c (OK!)
    sdcc  -mpic14 -p16f877a -c led.c    (OK!)
    gplink -m -sp16f877a.lkr -o tt.hex led.o main.o   (fail)

    output:p16f877a.lkr: No such file or directory

    Why? (my OS is WIN XP)

     
    • Raphael Neider
      Raphael Neider
      2009-03-09

      You either need to copy p16f877a.lkr to your project or leave out the -sp16f877a.lkr option; gplink should find its linker-script automatically. As a third option, you can pass the complete path (-s/path/to/p16f877a.lkr).

      Good luck,
      Raphael

      PS: You probably need to add pic16f877a.lib and libsdcc.lib as well. See the output of
      sdcc -mpic14 -V main.o led.o
      to find out how sdcc calls the linker.

       
    • aozima
      aozima
      2009-03-10

      OK!
      command:
      sdcc -mpic14 -p16f877a -V -o main.hex main.o led.o > msg.txt

      msg.txt:
      message: using default linker script "E:\aozima\SOFT\gputils\lkr\16f877a.lkr"
      + E:\aozima\SOFT\gputils\bin\gplink.exe -I"E:\aozima\SOFT\SDCC\bin\..\lib"  -I"E:\aozima\SOFT\SDCC\bin\..\lib\pic"   -w -r -o tt.hex   main.o led.o  libsdcc.lib pic16f877a.lib

      I will write a wizard(MCS51 and PIC) for codeblocks!

      Thanks!
      aozima