歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux基礎 >> Linux技術

Linux錯誤 curses.h:No such file or directory解決方案

在Linux上編譯代碼時,遇到以下錯誤信息:

curses.h:No such file or directory

查閱相關資料,整理了下解決方案:

在Debian/ Ubuntu Linux系統中,我們可以使用以下命令來安裝ncurses:

$ sudo apt-get install libncurses5-dev libncursesw5-dev

而我使用的是 CentOS版本的Linux,其解決辦法有點不一樣,具體是,在RHEL / Fedora/ CentOS Linux中,我們使用以下命令:

# yum install ncurses-devel ncurses

安裝過程大致如下:

[root@localhost test]# yum install ncurses-devel ncurses

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

* addons:centos.ustc.edu.cn

* base:centos.ustc.edu.cn

* commercial-addons:elastix.adaptixnetworks.com

* elastix-base:elastix.adaptixnetworks.com

* elastix-extras:elastix.adaptixnetworks.com

* elastix-updates:elastix.adaptixnetworks.com

* epel:mirrors.neusoft.edu.cn

* extras:ftp.sjtu.edu.cn

* updates: centos.ustc.edu.cn

Excluding Packages from CentOS-5 - Addons

Finished

Excluding Packages from CentOS-5 - Base

Finished

Excluding Packages from CentOS-5 - Extras

Finished

Excluding Packages from CentOS-5 - Updates

Finished

Setting up Install Process

Package ncurses-5.5-24.20060715.i386 already installed andlatest version

Resolving Dependencies

--> Running transaction check

---> Package ncurses-devel.i386 0:5.5-24.20060715 set tobe updated

--> Finished Dependency Resolution

Dependencies Resolved

================================================================================

Package Arch Version Repository Size

================================================================================

Installing:

ncurses-devel i386 5.5-24.20060715 base 1.6 M

Transaction Summary

================================================================================

Install 1Package(s)

Upgrade 0Package(s)

Total download size: 1.6 M

Is this ok [y/N]: y

Downloading Packages:

ncurses-devel-5.5-24.20060715.i386.rpm | 1.6 MB 00:01

Running rpm_check_debug

Running Transaction Test

Finished Transaction Test

Transaction Test Succeeded

Running Transaction

Installing : ncurses-devel 1/1

Installed:

ncurses-devel.i3860:5.5-24.20060715

Complete!

安裝完成後,重新編譯程序,一切正常!

Copyright © Linux教程網 All Rights Reserved