- 论坛徽章:
- 0
|
今天照书上打的一个小的关于curses.h小的程序
出现一大堆
/tmp/ccOlY0oN.o(.text+0x1d): In function `main':
: undefined reference to `initscr'
之类的错误。检查过目录确实有curses.h这个库。在红旗5liunx下用vim打的。
源代码如下:
/* hello1.c
* purpose show the minimal calls needed to use curse
* outline initialize, draw stuff, wait for input, quit
*/
#include <stdio.h>
#include <curses.h>
main()
{
initscr(); /* turn on curses */
/* send requests */
clear(); /* clear screen */
move(10,20); /* row10, col20 */
addstr("Hello, world"); /* add a string */
move(LINES - 1, 0); /* move to LL */
refresh(); /* update the screen */
getch(); /* wait for user input */
endwin(); /* turn off curses */
}
恳请各位前辈赐教 >.< |
|