From: Gunther M. <g....@tu...> - 2002-01-17 20:54:34
|
Dear SDCC users, I have a little problem using SDCC: When I try to call the printf() function from stdio.h, I get an error message like that: ?ASlink-Warning-Undefined Global '_putchar' referenced by module 'vprintf' I tried to write a putchar function, but then it is said that it already exists. The following command line is used to call SDCC: sdcc -IG:\sdcc\share\sdcc\include -LG:\sdcc\share\sdcc\lib\small hello.c Could you please give me a hint? Thank you very much, Gunther |
From: Mike C. <cr...@ps...> - 2002-04-16 18:43:08
|
Hello, I am having problems with outputting strings using the %s delimeter under printf. We are using cygnal's 8051 processor and the large memory model and are linking the large memory model library. I am using the CVS version of sdcc. The code fragment that doesn't work looks something like this; xdata char theString[0x20]; printf("the string is <%s>\r\n", theString); // this does not work while this code fragment seems to work fine while(theString[i]) // this does work { printf("%c",theString[i]); i++; } I think that it is a xdata type of issue, but can't seem to get my hands around it. Any ideas? Thanks in advance Mike |
From: Jesus Calvino-F. <je...@in...> - 2002-04-16 21:56:21
|
Are you initializing the string? I tried this code (large model): xdata char theString[0x20]; strcpy(theString, "Hello..."); printf("the string is <%s>\r\n", theString); and it works. What version of sdcc are you using? Try sdcc -v. The version I use is: D:\sdcc\bin>sdcc -v SDCC : mcs51/gbz80/z80/avr/ds390/pic14/TININative/xa51 2.3.1 (Mar 1 2002) (UNIX) Regards, At 11:43 AM 4/16/02 , Mike Crowe wrote: >Hello, >I am having problems with outputting strings using the %s delimeter >under printf. We are using cygnal's 8051 processor and the large memory >model and are linking the large memory model library. I am using the >CVS version of sdcc. > >The code fragment that doesn't work looks something like this; > >xdata char theString[0x20]; > >printf("the string is <%s>\r\n", theString); // this does not work > > >while this code fragment seems to work fine > >while(theString[i]) // this does work >{ > printf("%c",theString[i]); > i++; >} > >I think that it is a xdata type of issue, but can't seem to get my hands >around it. >Any ideas? > >Thanks in advance >Mike > > >_______________________________________________ >Sdcc-user mailing list >Sdc...@li... >https://lists.sourceforge.net/lists/listinfo/sdcc-user >=20 --------------------------------------------------- Jesus Calvino-Fraga, Ph.D. Candidate Address: Department of Electrical and Computer Engineering University of British Columbia 2356 Main Mall Vancouver, BC, Canada V6T 1Z4 Voice: (604) 822-0532 or (604) 228-2710 Fax:=A0=A0 (604) 822-5949 Email: je...@in... |