This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

About C/getch() errror




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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]