linux源碼安裝tmux和ncurses

總共分爲兩步:

1. 安裝ncusers。

下載地址https://ftp.gnu.org/gnu/ncurses/

我安裝tmux的時候瘋狂被報ncurses.h找不到。錯誤如下:

checking for curses.h... no
configure: error: "curses not found"

看了下configure的邏輯,tmux想使用pkg-config來找nurses這個庫,但是我是源碼安裝的且沒有root權限,所以得自己寫curses.pc纔可以。

1.1 安裝ncurses

我下載的是6.2,道理上高版本都可行。然後./configure && make -j 32 && make install 等

1.2 配置pc文件

因爲手動安裝的是沒有pc文件的,所以得自己寫。

1.2.1 配置pkg-config的搜索目錄

配置環境變量PKG_CONFIG_PATH=你要寫pc文件的目錄。

1.2.2 寫pc文件

touch ncurses.pc

然後寫入:

Name: ncurses
Description:ncurses
Version: 6.2
Cflags:-I/data1/users/zhaozheng09/local/local_tmux/include/ncurses/ -I/data1/users/zhaozheng09/local/local_tmux/include/
Libs:-L/data1/users/zhaozheng09/local/local_tmux/lib/ -lncurses -lncurses++

名字啥的應該是不能換的。

1.2.1中的目錄就是該文件所在的目錄。

2. 安裝tmux。

重新./configure即可。

 

如果aclocal:not found

則安裝automake

https://blog.csdn.net/qq_30549833/article/details/72955881

如果error: possibly undefined macro: AC_SEARCH_LIBS

則安裝 pkg-config

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章