linux编译curses报错,Linux Error: curses.h: No such file or directory

在使用Fedora 7交叉编译μclinux时,当使用make

menuconfig 进行配置时会出现缺少curses.h的错误。错误如下:

make[1]: Entering directory

`/root/uClinux-dist/config/kconfig'

cc

-DCURSES_LOC="" -c -o mconf.o mconf.c

In file included from mconf.c:27:

lxdialog/dialog.h:32:20: error: curses.h: No such file or

directory

In file included from mconf.c:27:

lxdialog/dialog.h:97: error: expected specifier-qualifier-list

before ‘chtype’

lxdialog/dialog.h:187: error: expected ‘)’ before ‘*’ token

lxdialog/dialog.h:193: error: expected ‘)’ before ‘*’ token

lxdialog/dialog.h:195: error: expected ‘)’ before ‘*’ token

lxdialog/dialog.h:196: error: expected ‘)’ before ‘*’ token

lxdialog/dialog.h:197: error: expected ‘)’ before ‘*’ token

lxdialog/dialog.h:198: error: expected ‘)’ before ‘*’ token

lxdialog/dialog.h:200: error: expected ‘)’ before ‘*’ token

mconf.c: In function ‘conf’:

mconf.c:610: error: ‘KEY_MAX’ undeclared (first use in this

function)

mconf.c:610: error: (Each undeclared identifier is reported only

once

mconf.c:610: error: for each function it appears in.)

mconf.c: In function ‘conf_choice’:

mconf.c:761: error: ‘KEY_MAX’ undeclared (first use in this

function)

make[1]: *** [mconf.o] Error 1

make[1]: Leaving directory

`/root/uClinux-dist/config/kconfig'

make: *** [/root/uClinux-dist/config/kconfig/mconf] Error 2

出现该错误的原因是在使用menuconfig时,需要ncurses库的支持,该库包含ncurses和ncurses-devel两个包,大部分情况ncurses包会跟随系统安装好,而ncurses-devel包根据安装系统时你的选择。可以使用如下命令查看他们有没有安装:

rpm -q

ncurses

rpm -q

ncurses-devel

如果安装好了,回显示:

ncurses-5.6-9.20070812.fc7

ncurses-devel-5.6-9.20070812.fc7

若没有安装,则使用yum命令进行安装(要求联网):

yum

install ncurses

yum

install ncurses-devel

安装完成,问题解决。

若是在Ubuntu系统下,类似问题可以使用如下命令解决:

sudo apt-get install libncurses5-dev

libncursesw5-dev

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值