undefined symbol

Author
rudie86
New Member
  • Total Posts : 17
  • Reward points : 0
  • Joined: 2008/06/24 05:17:20
  • Location: 0
  • Status: offline
2008/08/07 04:57:57 (permalink)
0

undefined symbol

hello guys,
 
i have just installed mplab. And i want to try a simple program:
 
#include <stdio.h>
#include <pic.h>
#pragma config WDT = OFF
void main (void)
{
printf("hello world");
while(1);
}
 
if i want to build the program i get the following error:
 
Build C:\Documents and Settings\ruud\My Documents\probeer for device 16F690
Using driver C:\Program Files\HI-TECH Software\PICC\PRO\9.60\bin\picc.exe
Executing: "C:\Program Files\HI-TECH Software\PICC\PRO\9.60\bin\picc.exe" --pass1 "C:\Documents and Settings\ruud\My Documents\probeer.c" -q --chip=16F690 -P --opt=default -g --asmlist "--errformat=Error   [%n] %f; %l.%c %s" "--msgformat=Advisory[%n] %s" "--warnformat=Warning [%n] %f; %l.%c %s"
Warning [335] C:\Documents and Settings\ruud\My Documents\probeer.c; 3.1 unknown pragma "config"
Warning [335] C:\Documents and Settings\ruud\My Documents\probeer.c; 3.1 unknown pragma "WDT"
Warning [335] C:\Documents and Settings\ruud\My Documents\probeer.c; 3.1 unknown pragma "="
Warning [335] C:\Documents and Settings\ruud\My Documents\probeer.c; 3.1 unknown pragma "OFF"
Executing: "C:\Program Files\HI-TECH Software\PICC\PRO\9.60\bin\picc.exe" -oprobeer.cof -mprobeer.map --runtime=default --summary=default --output=default probeer.p1 --chip=16F690 -P --opt=default -g --asmlist "--errformat=Error   [%n] %f; %l.%c %s" "--msgformat=Advisory[%n] %s" "--warnformat=Warning [%n] %f; %l.%c %s"
HI-TECH C PRO for the PIC10/12/16 MCU family  V9.60PL3
Copyright (C) 1984-2008 HI-TECH SOFTWARE
licensed for evaluation purposes only
this licence will expire on Sun, 21 Sep 2008
Error   [499] ; 0. undefined symbol:
 _putch(probeer.obj)
********** Build failed! **************

 
can somebody please help me.
 
greets rudie
#1

8 Replies Related Threads

    leon_heller
    Super Member
    • Total Posts : 6410
    • Reward points : 0
    • Joined: 2004/08/17 13:19:45
    • Location: St. Leonards-on-Sea, E. Sussex, UK.
    • Status: offline
    RE: undefined symbol 2008/08/07 05:12:30 (permalink)
    0
    Does Hi-Tech C support those pragmas? You should check the documentation.

    Leon


    Leon Heller
    G1HSM

    #2
    dhenry
    Super Member
    • Total Posts : 4994
    • Reward points : 0
    • Joined: 2003/11/07 12:35:12
    • Location: Colorado
    • Status: offline
    RE: undefined symbol 2008/08/07 05:14:11 (permalink)
    0
    You need to review the compiler manual for a couple of reasons:
    1. The compiler does not use #pragma for configuration fuse settings.  See the __CONFIG() macro instead.
    2. The requirements for using standard I/O functions is described there.
    #3
    rudie86
    New Member
    • Total Posts : 17
    • Reward points : 0
    • Joined: 2008/06/24 05:17:20
    • Location: 0
    • Status: offline
    RE: undefined symbol 2008/08/07 05:14:26 (permalink)
    0
    i don't know but if i take it away i will still get the same error
     
    greets rudie
    #4
    rudie86
    New Member
    • Total Posts : 17
    • Reward points : 0
    • Joined: 2008/06/24 05:17:20
    • Location: 0
    • Status: offline
    RE: undefined symbol 2008/08/07 05:22:37 (permalink)
    0
    i have looked in the datasheet but i see were the fault lies. the code is so easy so i thinking more of a linker problem somewere but i don't know were.
     
    greets rudie
    #5
    dhenry
    Super Member
    • Total Posts : 4994
    • Reward points : 0
    • Joined: 2003/11/07 12:35:12
    • Location: Colorado
    • Status: offline
    RE: undefined symbol 2008/08/07 05:35:39 (permalink)
    0
    ORIGINAL: rudie86

    i have looked in the datasheet ...

    But did you look in the compiler manual?  Did you read about the need to provide a putch()?
    #6
    rudie86
    New Member
    • Total Posts : 17
    • Reward points : 0
    • Joined: 2008/06/24 05:17:20
    • Location: 0
    • Status: offline
    RE: undefined symbol 2008/08/07 06:41:32 (permalink)
    0
    my fault sorry. i have found the solution
     
    thanks for your help
     
    greets rudie
    #7
    burke_davison
    Moderator
    • Total Posts : 197
    • Reward points : 0
    • Joined: 2008/10/08 14:31:28
    • Location: Microchip Technology - Chandler, AZ
    • Status: offline
    RE: undefined symbol 2008/10/08 14:38:32 (permalink)
    0
    I recently came upon this same issue. The error looked like this:
    Error   [499] ; 0. undefined symbol: 
    _history(project.obj)
    I found that the problem occurred because I incorrectly defined the variable.
    Before, I had only this definition in my main.h file:
    extern unsigned int    history[HISTORY_MEMORY];
    I added the following definition to my main.c file (leaving the line in main.h intact):
    unsigned int    history[HISTORY_MEMORY];

    This solved the problem for me.
    #8
    ve6dai
    New Member
    • Total Posts : 1
    • Reward points : 0
    • Joined: 2011/10/31 17:23:59
    • Location: 0
    • Status: offline
    Re:undefined symbol 2011/10/31 17:29:37 (permalink)
    0
    [HI-TECH]undefined symbol: _putch

    Issue
    When compiling my code with PICC PRO I get this error:
    Error [499] ; 0. undefined symbol:
    _putch(test.obj)

    Solution
    The printf() function calls another function putch() to output the character after formatting. By default putch() is defined as an empty function. To allow printf() to write to a specific output the putch() function needs to be redefined. In most cases output is directed to the serial port. A sample definition can be found in the serial.c file in the samples directory of the compiler distribution (in iserial.c) for the PICC and PICC18 compilers.
    #9
    Jump to:
    © 2017 APG vNext Commercial Version 4.5