如何从源代码安装 tmux?

如何从源代码安装 tmux?

我已经下载tmux并尝试在 Ubuntu 10.04 上安装它。

$ ./configure 
Configured for Linux
$ make
cc -DBUILD="\"1.3\"" -std=c99 -D_GNU_SOURCE -D_POSIX_SOURCE -iquote.   -c -o attributes.o attributes.c
In file included from attributes.c:23:
tmux.h:30:19: error: event.h: No such file or directory
In file included from attributes.c:23:
tmux.h:831: error: field ‘name_timer’ has incomplete type
tmux.h:1025: error: field ‘key_timer’ has incomplete type
tmux.h:1086: error: field ‘event’ has incomplete type
tmux.h:1102: error: field ‘repeat_timer’ has incomplete type
tmux.h:1122: error: field ‘identify_timer’ has incomplete type
tmux.h:1125: error: field ‘message_timer’ has incomplete type
make: *** [attributes.o] Error 1

答案1

错误告诉您缺少头文件 event.h,它可能是 libevent 的一部分。

为了能够编译程序,您需要先安装它的所有依赖项(包括标头、-dev 包)。在 tmux 网页中,他们说它依赖于 libevent 和 ncurses。因此,此命令可能会安装您需要的所有内容(未经测试):

sudo apt-get install libevent-1.4 libevent-dev libncurses5-dev

但是如果您需要问这个问题,那么您可能不应该从源代码编译东西,除非您是为了学习,只是为了好玩,或者只是度过糟糕的一天;)。

相关内容