Jani Asikainen - 2008-09-05

Hi, this is my "little" problem, I try compile this simple code but linker gives me error.
Linker works ok when i dont use any includes, like simple led flash program.
I try google the problem but no luck.

SDCC : mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08 2.8.3 #5228 (Sep  4 2008) (UNIX)
gplink-0.13.6 alpha

piklab: version 0.15.2 (rev. distribution)
Qt: 3.3.8b
KDE: 3.5.9
Piklab: 0.15.2

Code:

#include <pic18fregs.h>

#include <stdio.h>
#include <usart.h>

void stdio_init()
{
    usart_open(
        USART_TX_INT_OFF
            & USART_RX_INT_OFF
            & USART_BRGH_HIGH
            & USART_ASYNCH_MODE
            & USART_EIGHT_BIT,
        10
        );

    stdout = STREAM_USART;
}

void main()
{
    stdio_init();
    printf("hello, world\n");
}

Compile:

sdcc -mpic16 -p18f452 -V --debug -I/home/jassi/Tmp/PikLab/koe/ -c hellotty.c
+ "/usr/local/bin/sdcpp" -nostdinc -Wall -I"/home/jassi/Tmp/PikLab/koe/" -Dpic18f452 -D__18f452 -DSTACK_MODEL_SMALL -obj-ext=.o -DSDCC_MODEL_SMALL -DSDCC=283 -DSDCC_REVISION=5228 -DSDCC_pic16 -D__pic16 -I"/usr/local/bin/../share/sdcc/include/pic16" -I"/usr/local/share/sdcc/include/pic16" -I"/usr/local/bin/../share/sdcc/include" -I"/usr/local/share/sdcc/include"  "hellotty.c"
+ "/usr/local/bin/gpasm" -DSDCC_MODEL_SMALL -DSTACK_MODEL_SMALL -g -c "hellotty.asm" -o "hellotty.o"
gpasm -c -I/home/jassi/Tmp/PikLab/koe/ -w0 hellotty.asm
hellotty.asm:10: warning: directive ignored when debug info is disabled
hellotty.asm:192: warning: directive ignored when debug info is disabled
hellotty.asm:194: warning: directive ignored when debug info is disabled
hellotty.asm:209: warning: directive ignored when debug info is disabled
hellotty.asm:212: warning: directive ignored when debug info is disabled
hellotty.asm:222: warning: directive ignored when debug info is disabled
sdcc -mpic16 -p18f452 -V --debug -Wl-c -Wl-m -I/home/jassi/Tmp/PikLab/koe/ -ohellotty.hex hellotty.o
using default linker script "/usr/local/share/gputils/lkr/18f452.lkr"
missing definition for symbol "_stdout", required by "hellotty.o"
missing definition for symbol "_printf", required by "hellotty.o"
missing definition for symbol "_usart_open", required by "hellotty.o"

+ "/usr/local/bin/gplink" -I"/usr/local/bin/../share/sdcc/lib/pic16" -I"/usr/local/share/sdcc/lib/pic16" -I"/usr/local/bin/../share/sdcc/lib" -I"/usr/local/share/sdcc/lib"  -c -m  -w -r -o hellotty.hex  hellotty.o  crt0i.o libdev18f452.lib libsdcc.lib
+ "/usr/local/bin/gplink" -I"/usr/local/bin/../share/sdcc/lib/pic16" -I"/usr/local/share/sdcc/lib/pic16" -I"/usr/local/bin/../share/sdcc/lib" -I"/usr/local/share/sdcc/lib"  -c -m  -w -r -o hellotty.hex  hellotty.o  crt0i.o libdev18f452.lib libsdcc.lib  returned errorcode 256

*** Exited with status: 1 ***

Ideas?
Thanks.