|
|
我本来想写一个小游戏,结果发现我的许多curses函数不能用,于是我写了一个测试小程序,请大家指点一下。源代码如下:
#include <stdio.h>
#include <curses.h>
main()
{
initscr();
clear();
move(10,20);
addstr("AAAAAA");
move(LINES-1,0);
refresh();
getch();
endwin();
}
错误显示如下:
/tmp/ccEmDUvu.o(.text+0x11): In function `main':
/home/code2/hello.c:8: undefined reference to `initscr'
/tmp/ccEmDUvu.o(.text+0x1a):/home/code2/hello.c:9: undefined reference to `stdscr'
/tmp/ccEmDUvu.o(.text+0x1f):/home/code2/hello.c:9: undefined reference to `wclear'
/tmp/ccEmDUvu.o(.text+0x32):/home/code2/hello.c:10: undefined reference to `LINES'
/tmp/ccEmDUvu.o(.text+0x47):/home/code2/hello.c:11: undefined reference to `stdscr'
/tmp/ccEmDUvu.o(.text+0x4c):/home/code2/hello.c:11: undefined reference to `wmove'
/tmp/ccEmDUvu.o(.text+0x76):/home/code2/hello.c:13: undefined reference to `stdscr'
/tmp/ccEmDUvu.o(.text+0x8d):/home/code2/hello.c:14: undefined reference to `stdscr'
/tmp/ccEmDUvu.o(.text+0x92):/home/code2/hello.c:14: undefined reference to `waddnstr'
/tmp/ccEmDUvu.o(.text+0xb5):/home/code2/hello.c:16: undefined reference to `stdscr'
/tmp/ccEmDUvu.o(.text+0xc5):/home/code2/hello.c:17: undefined reference to `stdscr'
/tmp/ccEmDUvu.o(.text+0xca):/home/code2/hello.c:17: undefined reference to `wrefresh'
/tmp/ccEmDUvu.o(.text+0xd6):/home/code2/hello.c:18: undefined reference to `stdscr'
/tmp/ccEmDUvu.o(.text+0xdb):/home/code2/hello.c:18: undefined reference to `wgetch'
/tmp/ccEmDUvu.o(.text+0xe3):/home/code2/hello.c:19: undefined reference to `endwin'
collect2: ld returned 1 exit status
谢谢
P.S 我用的是RH9.0,如果必要的话,我会把curses.h的源码贴出来。 |
|