This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

linker warning: UNRESOLVED EXTERNAL SYMBOL

Hi

I have a very simple code (see below linker warning) and I get following linker warning. Im working with the Silicon Laboratories IDE. How can I solve this problem? What do I have to change? Do you need more information?

Kind Regards
Peter
(

BL51 BANKED LINKER/LOCATER V5.15 - SN: Cygnal_8051Fxxx
COPYRIGHT KEIL ELEKTRONIK GmbH 1987 - 2004
D:\SiLabs\pause\main.obj TO
D:\SiLabs\pause\main RS(256) PL(68) PW(78) IX

*** WARNING L1: UNRESOLVED EXTERNAL SYMBOL SYMBOL: _PAUSE MODULE: D:\SILABS\PAUSE\MAIN.OBJ (MAIN)

*** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL SYMBOL: _PAUSE MODULE: D:\SILABS\PAUSE\MAIN.OBJ (MAIN) ADDRESS: 0014H

******************************************************************************
* RESTRICTED VERSION WITH 1000H BYTE CODE SIZE LIMIT; USED: 0016H BYTE ( 0%) *
******************************************************************************

Program Size: data=9.0 xdata=0 code=22
LINK/LOCATE RUN COMPLETE. 2 WARNING(S), 0 ERROR(S)

// main.c
#include "pause.h"

void main(void){
pause(100);
}

-----------------

// Pause.h
#ifndef PAUSE_H //Includeguard
#define PAUSE_H
void pause(int x);
#endif //PAUSE_H

-------------------

// Pause.c
#include "pause.h"
void pause(int x){
int i;
for (i=0; i<x; i++){}
}

Parents Reply Children
  • Hi Erik

    Thanks for your answer. That was the reason why it did not work. I saw that only the "main" is linked. The "pause.obj" was complied but not linked. So I needed to add the file manually (under Project Build Definitions / Files to Link). Now it works just fine.

    Have a nice day.
    Regards
    Peter

  • "The "pause.obj" was complied but not linked."

    Aha: so, as far as the Linker was concerned, it had no definition of 'pause' - which is the 2nd of the reasons quoted from the manual.

    "So I needed to add the file manually (under Project Build Definitions / Files to Link)."

    Sounds like a pretty clunky "IDE" if you have to do that manually - not very "Integrated" at all!

  • Hi Andy

    yes, your right, but I thought that the IDE will link this file beause I included it in the main.c. ...well however.

    by the way, you're right again...this "IDE" IS very clunky...shame on Silabs ;-)

    Kind Regards
    Peter

  • by the way, you're right again...this "IDE" IS very clunky...shame on Silabs
    not very important, it would be far nore important that the components of the IDE (case in point the debugger) were bug free. Any competent developer can work without being an IDEiot, none can work (efficiently) with buggy tools.

    Erik