mplink: not valid COFF file

Pavel
2007-10-20
2015-09-17
  • 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

         
  • Stephen Higgins

    Stephen Higgins - 2015-09-17

    I've got the same problem today. I've compiled a test.c into test.asm on Code::Blocks using SDCC 3.5.0, which of course requires libsdcce.lib to resolve sdcc_gsinit_startup...

    MPLINK 4.49, Linker
    Device Database Version 1.14
    Copyright (c) 1998-2011 Microchip Technology Inc.
    Error - could not find definition of symbol 'sdcc_gsinit_startup' in file '..\temp\test.o'.
    Errors : 1

    When I add libsdcce.lib to the link, I get Coff file '' does not appear to be a valid COFF file. The SDCC manual says I should be able to use MPLINK, which I prefer to do as I have quite a bit of assembler support routines, and few C applications. Any ideas on what I'm doing wrong? Or in the worst case, how do I take the SDCC source for the pic14 and build a minimal Code::Block project to rebuild the 2 libs? (which shouldn't really be necessary, eh?) Thanks in advance!!

    Using MPLAB 8.92 with MPASM suite (mpasmwin v5.51, mplink v4.49) I have an XP machine and company policy is to try to stay on XP.


    Debug build of project C:\KairosSW\tinyRTX pic16\tinyRTX pic16f1847.mcp' started. Language tool versions: MPASMWIN.exe v5.51, mplink.exe v4.49, mplib.exe v4.49 Preprocessor symbolDEBUG' is defined.
    Thu Sep 17 16:23:54 2015


    Make: The target "C:\KairosSW\tinyRTX pic16\temp\si2c.o" is up to date.
    Make: The target "C:\KairosSW\tinyRTX pic16\temp\sisd.o" is up to date.
    Make: The target "C:\KairosSW\tinyRTX pic16\temp\slcd.o" is up to date.
    Make: The target "C:\KairosSW\tinyRTX pic16\temp\srtx.o" is up to date.
    Make: The target "C:\KairosSW\tinyRTX pic16\temp\strc.o" is up to date.
    Make: The target "C:\KairosSW\tinyRTX pic16\temp\susr.o" is up to date.
    Make: The target "C:\KairosSW\tinyRTX pic16\temp\uadc.o" is up to date.
    Make: The target "C:\KairosSW\tinyRTX pic16\temp\uapp.o" is up to date.
    Make: The target "C:\KairosSW\tinyRTX pic16\temp\ui2c.o" is up to date.
    Make: The target "C:\KairosSW\tinyRTX pic16\temp\ulcd.o" is up to date.
    Make: The target "C:\KairosSW\tinyRTX pic16\temp\sm16.o" is up to date.
    Make: The target "C:\KairosSW\tinyRTX pic16\temp\sbcd.o" is up to date.
    Make: The target "C:\KairosSW\tinyRTX pic16\temp\smul.o" is up to date.
    Make: The target "C:\KairosSW\tinyRTX pic16\temp\test.o" is up to date.
    Make: The target "C:\KairosSW\tinyRTX pic16\output\tinyRTX pic16f1847.cof" is out of date.
    Executing: "C:\Program Files\Microchip\MPASM Suite\mplink.exe" /p16F1847 "..\TinyRTX-PIC16F877.lkr" "..\temp\si2c.o" "..\temp\sisd.o" "..\temp\slcd.o" "..\temp\srtx.o" "..\temp\strc.o" "..\temp\susr.o" "..\temp\uadc.o" "..\temp\uapp.o" "..\temp\ui2c.o" "..\temp\ulcd.o" "..\temp\sm16.o" "..\temp\sbcd.o" "..\temp\smul.o" "..\temp\test.o" "C:\KairosSW\tinyRTX pic16\libsdcce.lib" "C:\KairosSW\tinyRTX pic16\libme.lib" /u_DEBUG /zMPLAB_BUILD=1 /zMPLAB_DEBUG=1 /u16F1847 /o"tinyRTX pic16f1847.cof" /M"tinyRTX pic16f1847.map" /W
    MPLINK 4.49, Linker
    Device Database Version 1.14
    Copyright (c) 1998-2011 Microchip Technology Inc.
    Error - Coff file '' does not appear to be a valid COFF file.
    Error - Could not build member '' in library file 'C:\KairosSW\tinyRTX pic16\libsdcce.lib'.
    Errors : 2

    Debug build of project C:\KairosSW\tinyRTX pic16\tinyRTX pic16f1847.mcp' failed. Language tool versions: MPASMWIN.exe v5.51, mplink.exe v4.49, mplib.exe v4.49 Preprocessor symbolDEBUG' is defined.
    Thu Sep 17 16:23:57 2015


    BUILD FAILED

    **

     
    Last edit: Stephen Higgins 2015-09-17

Log in to post a comment.