On Thu, May 13, 2010 at 12:57:07AM -0700, Duygu Altinok wrote:
> Hi,
> I'm new to piklab and sdcc   , when I try to compile some stuff our 
> instructors gave us I get the following error:
> 
> sdcc -mpic14 -p16f877 -V --debug -I/home/duygu/ceng4/ -c 
> ceng336/hw3_lcd_examples/lcd.c 
> + "/usr/bin/sdcpp" -nostdinc -Wall -std=c99 -I"/home/duygu/ceng4/" 
> -obj-ext=.o -DSDCC_MODEL_SMALL -DSDCC=280 -DSDCC_REVISION=5117 -DSDCC_pic14 
> -D__pic14 -DSDCC_PROCESSOR="16f877" -I"/usr/bin/../share/sdcc/include/pic14" 
> -I"/usr/share/sdcc/include/pic14" -I"/usr/bin/../share/sdcc/include" 
> -I"/usr/share/sdcc/include" -I"/usr/bin/../share/sdcc/include/pic" 
> -I"/usr/share/sdcc/include/pic" "ceng336/hw3_lcd_examples/lcd.c"  
> sdcc -mpic14 -p16f877 -V --debug -I/home/duygu/ceng4/ -c 
> ceng336/hw3_lcd_examples/lcd_demo.c 
> demo1 
> glue.c:1956: emitInitVal: Assertion `!"Initialized char-arrays are not yet 
> supported, assign at runtime instead."' failed. 

<snip>

        It looks to be unable to support this (yet):
> 
> static const char demo1[] = "+--------------+";
> static const char demo2[] = "|   Ceng 336   |";
> static const char demo3[] = "| SDCC LCD demo|";
> static const char demo4[] = "+--------------+";
> 

        and needs something like this to change the assignment from compile
time to run time as the assert suggested. You probably will neet to add

#include <string.h>

to pick up the strcpy() prototype as well. 

> void writeDemo()
> {
>     int i;

      char demo1[20];
      char demo2[20];
      char demo3[20];
      char demo4[20]; 

      strcpy(demo1,"+--------------+");
      strcpy(demo2,"|   Ceng 336   |");
      strcpy(demo3,"| SDCC LCD demo|");
      strcpy(demo4,"+--------------+");

>     lcdGoto(START_OF_LINE1);
>     for(i = 0; demo1[i]; i++)
>         lcdWrite(demo1[i]);
<snip>

Peter Van Epp

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

_______________________________________________
Sdcc-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to