#12 ASlink-Warning-Undefined Global '_putcha

closed
Bernhard Held
None
5
2003-05-08
2002-10-18
Anonymous
No

I have this error when compiling hello.c

?ASlink-Warning-Undefined Global '_putchar' referenced
by module 'vprintf'

C:\sdcc\bin>sdcc hello.c

library file /sdcc/share/sdcc/lib/small/libsdcc.lib
library file /sdcc/share/sdcc/lib/small/libint.lib
library file /sdcc/share/sdcc/lib/small/liblong.lib
library file /sdcc/share/sdcc/lib/small/libfloat.lib

?ASlink-Warning-Undefined Global '_putchar' referenced
by module 'vprintf'

C:\sdcc\bin>ls
as-gbz80.exe hello.asm hello.lst hello.sym sdcc.exe
as-z80.exe hello.c hello.map link-gbz80.exe
sdcpp.exe
aslink.exe hello.ihx hello.rel link-z80.exe
sdcppold.exe
asx8051.exe hello.lnk hello.rst packihx.exe

C:\sdcc\bin>sdcc -v
SDCC : mcs51/gbz80/z80/avr/ds390/pic14 2.3.0 (Sep 20
2001) (UNIX)

C:\sdcc\bin>tail 10 hello.c
tail: 10: No such file or directory
==> hello.c <==
#include<stdio.h>

void main()
{
printf("Hello, world!");
}

C:\sdcc\bin>

Discussion

  • byungoh kim
    byungoh kim
    2002-10-18

    Logged In: YES
    user_id=631453

    What shoud I do ?
    Please let me know.

     
  • Bernhard Held
    Bernhard Held
    2003-05-08

    • assigned_to: nobody --> bernhardheld
    • status: open --> closed
     
  • Bernhard Held
    Bernhard Held
    2003-05-08

    Logged In: YES
    user_id=203539

    putchar() outputs the character on stdout. SDCC can't know
    what's stdout on your board. Therfore you've to supply putchar
    ().