Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux 程式設計 >> Linux 程式設計

移植內核時 make menuconfig 報錯的解法

在移植內核時,終端機裡敲下 make menuconfig,卻迎面碰上一串錯誤:

*** Unable to find the ncurses libraries or the
*** required header files.
*** 'make menuconfig' requires the ncurses libraries.
***
*** Install ncurses (ncurses-devel) and try again.
***
make[1]: *** [scripts/kconfig/dochecklxdialog] Error 1
make: *** [menuconfig] Error 2

一看訊息就明白了:原來是 Ubuntu 系統裡少了 ncurses 這個庫。解法乾脆利落,一行指令補上即可:

sudo apt-get install ncurses-dev

ncurses 到底是什麼?

順帶把這個疑問查清楚。curses 其實是一層建在底層終端碼之上的封裝,為開發者提供了一套靈活又高效的 API(Application Programming Interface,應用程式介面)。有了它,移動游標、建立視窗、產生顏色、處理滑鼠操作這些事都能輕鬆搞定,程式設計師不必再為繁瑣的底層終端操作傷透腦筋。而 ncurses 正是這套 curses 的現代改良版——menuconfig 那個以文字圖形介面呈現的配置選單,靠的就是它。難怪少了它,menuconfig 連畫面都畫不出來。

Copyright © Linux教程網 All Rights Reserved