QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 698|回复: 2

新手求助

[复制链接]
发表于 2005-4-25 18:22:36 | 显示全部楼层 |阅读模式
刚开始学习,按照教材上输入
#include <curses.h>
main()
{
        int i;
       
        initscr();
        clear();
        for (i=0;i<LINES;i++)
        {
                move(i,i+i);
                if (i%2==1)
                        standout();
                addstr("Hello,world");
                if (i%2==1)
                        standend();
                refresh();
                sleep(1);
                move(i,i+i);
                addstr("            ");
        }
        endwin();
}
编译时
$ gcc hello.c -o hello
hello.c:22:2: warning: no newline at end of file
/tmp/cc8C4vmd.o(.text+0x1d): In function `main':
: undefined reference to `initscr'
/tmp/cc8C4vmd.o(.text+0x26): In function `main':
: undefined reference to `stdscr'
/tmp/cc8C4vmd.o(.text+0x2b): In function `main':
: undefined reference to `wclear'
/tmp/cc8C4vmd.o(.text+0x3e): In function `main':
: undefined reference to `LINES'
/tmp/cc8C4vmd.o(.text+0x57): In function `main':
: undefined reference to `stdscr'
/tmp/cc8C4vmd.o(.text+0x5c): In function `main':
: undefined reference to `wmove'
/tmp/cc8C4vmd.o(.text+0x7f): In function `main':
: undefined reference to `stdscr'
/tmp/cc8C4vmd.o(.text+0x96): In function `main':
: undefined reference to `stdscr'
/tmp/cc8C4vmd.o(.text+0x9b): In function `main':
: undefined reference to `waddnstr'
/tmp/cc8C4vmd.o(.text+0xbe): In function `main':
: undefined reference to `stdscr'
/tmp/cc8C4vmd.o(.text+0xce): In function `main':
: undefined reference to `stdscr'
/tmp/cc8C4vmd.o(.text+0xd3): In function `main':
: undefined reference to `wrefresh'
/tmp/cc8C4vmd.o(.text+0xf6): In function `main':
: undefined reference to `stdscr'
/tmp/cc8C4vmd.o(.text+0xfb): In function `main':
: undefined reference to `wmove'
/tmp/cc8C4vmd.o(.text+0x10e): In function `main':
: undefined reference to `stdscr'
/tmp/cc8C4vmd.o(.text+0x113): In function `main':
: undefined reference to `waddnstr'
/tmp/cc8C4vmd.o(.text+0x125): In function `main':
: undefined reference to `endwin'
collect2: ld returned 1 exit status

十分不解,麻烦各位高手帮忙看看为什么,谢谢~~
发表于 2005-4-25 18:59:12 | 显示全部楼层
gcc hello.c -o hello -lcurses
回复

使用道具 举报

 楼主| 发表于 2005-4-25 19:04:57 | 显示全部楼层
谢谢~谢谢~
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-11-6 07:40 , Processed in 0.038530 second(s), 16 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表