mplink: not valid COFF file

Pavel
2007-10-20
2013-03-12
  • Pavel
    Pavel
    2007-10-20

    Hello,
    I compiled simple file on WinXP with sdcc and assembled with mpasm but MPLINK reports errors:
    Error - Coff file '' does not appear to be a valid COFF file.
    Error - Could not build member '' in library file 'C:\Progra~1\SDCC\lib\pic\libsdcc.lib'.

    What am I doing wrong?

    Thank you for help.
    Pavel

    /* file one.c */
    int main()
    {
    int x,y,z;

    x=y=3;
    z=x+y;

    return 0;
    }

    U:\> "C:\Program Files\SDCC\bin\sdcc.exe" -S -V -mpic14 -p16F737 one.c
    + C:\PROGRA~1\SDCC\bin\sdcpp.exe -nostdinc -Wall -std=c99 -obj-ext=.o -DSDCC_MODEL_SMALL -DSDCC=270 -DSDCC_pic14 -D__pic14 -DSDCC_PROCESSOR="16F737" -I"C:\Program Files\SDCC\bin\..\include\pic14"
    -I"C:\Program Files\SDCC\bin\..\include" -I"C:\Program Files\SDCC\bin\..\include\pic"  "one.c"

    U:\> "C:\Program Files\Microchip\MPASM Suite\MPASMWIN.exe" /q /o one.asm

    U:\> "C:\Program Files\Microchip\MPASM Suite\mplink.exe" /v "C:\Program Files\Microchip\MPASM Suite\LKR\16f737.lkr" /m one.map /o one.hex one.O "C:\Progra~1\SDCC\lib\pic\libsdcc.lib"
    MPLINK 4.11, Linker
    Copyright (c) 2007 Microchip Technology Inc.
    Error - Coff file '' does not appear to be a valid COFF file.
    Error - Could not build member '' in library file 'C:\Progra~1\SDCC\lib\pic\libsdcc.lib'.
    Errors    : 2
    Warnings  : 0

    U:\> "C:\Program Files\SDCC\bin\sdcc.exe" --version
    SDCC : mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08 2.7.0 #4818 (May 31 2007) (MINGW32)

    Version of MPLAB: 7.60

     
    • franciscojar
      franciscojar
      2007-10-27

      Hi!

      The problem is the MPLAB, they change the format of their libraries, then the libsdcc.lib is not readable for the new mplink.

      If you use the MPLAB version 5 or 6, you can link without problem.

      By the way, the SDCC create the hex file for the PIC family so, why you want to use MPLAB?

      Regards.

      franciscojar

       
      • gello
        gello
        2008-10-24

        I have a similar problem.
        The reason to continue using MPLAB is that I already have 8 years of work archived there
        including a cooperative real time operating system. 
        SDCC would have been a nice
        addition to write user processes on top of this.

        Also, the simulation in mplab is pretty good if a little clunky when using stimulus files for
        asynchronous events.

        Has no one simply compiled the sources for the libs, relinked them with mplink, then archived
        them with mplib to generate a compatible binary tree with mplab?

        i will do it myself but surely it must exist somewhere already.

        thanks,  sdcc looks like a good compiler if i can solve the mplab compatibility issue
        without bleeding too many resources.

        gello