This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
About C/getch() errror
- To: gcc at gcc dot gnu dot org
- Subject: About C/getch() errror
- From: JN_Lin at utc dot com dot tw
- Date: Thu, 30 Sep 1999 17:31:25 +0800
Dear :
I cannot compile my program , because it show error message , below
====================================================================
In file included from /usr/include/curses.h:23,
from /usr/local/lib/gcc-lib/i386-pc-solaris2.7/2.95.1/include/,
from z.c:1:
/usr/include/widec.h:42: warning: `getwc' redefined
/usr/include/wchar.h:326: warning: this is the location of the previous definitn
/usr/include/widec.h:43: warning: `putwc' redefined
/usr/include/wchar.h:329: warning: this is the location of the previous definitn
/usr/include/widec.h:44: warning: `getwchar' redefined
/usr/include/wchar.h:327: warning: this is the location of the previous definitn
/usr/include/widec.h:45: warning: `putwchar' redefined
/usr/include/wchar.h:330: warning: this is the location of the previous definitn
Undefined first referenced
symbol in file
wgetch /var/tmp/ccHPfBne.o
stdscr /var/tmp/ccHPfBne.o
ld: fatal: Symbol referencing errors. No output written to a.out
collect2: ld returned 1 exit status
=========================================================================
and , this is my program , below
-------------------------------------------------------------
#include <curses.h>
#include <stdio.h>
main()
{
char a=0 , str[255]="\0" ;
int i = 0 ;
while(a != '\n')
{
//a=fgetc(stdin) ;
//fputc(a,stdout);
a=getch();
str[i++]=a ;
}
printf("%s" , str) ;
}
------------------------------------------------
Thanks
J.N. Lin