From: Daryl V. V. <dv...@te...> - 2005-05-04 03:58:26
|
Hi, Thanks for your quick responses so far guys. :) (And I feel a little stupid after finding the __shadowregs thing in the docs) I'm having problems compiling code that uses printf(). When I try to compile the code below I get the following results: #include <pic18fregs.h> #include <stdio.h> #pragma stack 0x00 64 void main(void) { stdout = STREAM_USART; printf("Hello World\n"); while(1); } $ sdcc -mpic16 -p18f452 -llibc18f.lib test.c Processor: 18f452 message: using default linker script "/home/daryl/local/share/gputils/lkr/18f452.lkr" error: multiple sections using address 0 I must be missing something obvious here. What is causing that? I've searched the list and did a little googling, but didn't find an answer. Do I need a custom linker script? Is setting stdout = STREAM_USART valid? I'm using a CVS version of sdcc from a couple days ago. I've also tried using printf_tiny() and defining my own putchar() as described in the docs. No luck. When I try to do it with -p18f1220 I get a different error: error: missing definition for symbol "_SSPBUF" The SSPBUF issue appears to stem from the fact that there is no ssp on the 18f1220 but the library code assumes there is. Also, building lib-io is broken for the 18f1220 because of no i2c support. Thanks, -Daryl. |