如何从源代码安装tmux?


12

我已经下载了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

Answers:


13

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

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

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

但是,如果您需要问这个问题,那么除非您正在学习,否则只是为了娱乐或度过了一个糟糕的日子,除非您是从源头整理东西;否则。


5
或者,由于它已经在存档中,因此您可以直接请求直接安装构建依赖项:sudo apt-get build-dep tmux
Kees Cook 2010年
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.