尝试在CentOS 6.x上安装tmux失败,并显示错误:未声明'EVBUFFER_EOL_LF'


11

我尝试使用以下步骤来编译tmux:

yum -y install ncurses-devel libevent-devel
wget http://downloads.sourceforge.net/tmux/tmux-1.9a.tar.gz
tar -xvzf tmux-1.9a.tar.gz
cd tmux-1.9a
./configure
make

make命令失败,出现以下错误:

control.c:64:47: error: ‘EVBUFFER_EOL_LF’ undeclared (first use in this function)

以下是安装的ncurses-devel和libevent-devel软件包的详细信息。

[root@rigel ~]# yum info ncurses-devel.x86_64 libevent-devel.x86_64
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: centosmirror.go4hosting.in
Installed Packages
Name        : libevent-devel
Arch        : x86_64
Version     : 1.4.13
Release     : 4.el6
Size        : 421 k
Repo        : installed
From repo   : base
Summary     : Header files, libraries and development documentation for libevent
URL         : http://monkey.org/~provos/libevent/
License     : BSD
Description : This package contains the static libraries documentation for libevent.
            : If you like to develop programs using libevent, you will need
            : to install libevent-devel.

Name        : ncurses-devel
Arch        : x86_64
Version     : 5.7
Release     : 3.20090208.el6
Size        : 1.7 M
Repo        : installed
From repo   : base
Summary     : Development files for the ncurses library
URL         : http://invisible-island.net/ncurses/ncurses.html
License     : MIT
Description : The header files and libraries for developing applications that use
            : the ncurses terminal handling library.
            :
            : Install the ncurses-devel package if you want to develop applications
            : which will use ncurses.

在CentOS 6.x上安装tmux的正确方法是什么?

Answers:


17

发生此问题是因为yum安装了libevent版本1.4,而tmux 1.9需要libevent版本2.0。解决方案是从源代码安装libevent 2.0版。

这是从头开始安装tmux的完整命令集。

yum -y install ncurses-devel

wget https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz
tar -xvzf libevent-2.0.22-stable.tar.gz
cd libevent-2.0.22-stable
./configure
make -j 4
make install
cd ..

wget https://github.com/tmux/tmux/releases/download/2.1/tmux-2.1.tar.gz
tar -xvzf tmux-2.1.tar.gz
cd tmux-2.1
./configure LDFLAGS="-Wl,-rpath,/usr/local/lib"
make -j 4
make install

这里有三个命令块。

  1. yum命令安装编译tmux所需的ncurses-devel软件包(如果尚不存在)。
  2. 然后,我们从源代码编译libevent 2.0版并进行安装。
  3. 然后,从源代码编译tmux 2.1版并进行安装。这样做时,我们确保将tmux链接到我们在/ usr / local / lib中安装的libevent,否则将出现此错误:tmux: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory

最后,执行tmux命令以启动tmux。


6
tmux的configure也接受以下内容:export LIBEVENT_CFLAGS =“-I / usr / local / include” export LIBEVENT_LIBS =“-L / usr / local / lib -Wl,-rpath = / usr / local / lib -levent” rpath会排除LD_LIBRAY_PATH更改,这对于您系统上的其他用户来说更加方便。
Ajith Antony

Google员工注意事项:我也已经在古老的Centos 5上成功使用了它。
Tyr

7

安装libevent 2 -devel libevent-devel的瞬间

在我的64位计算机上:

yum install libevent2-devel.x86_64

如果您已经安装了libevent-devel,请先将其卸载。


1

配置化妆开始我执行后的工作:

sudo yum erase libevent-devel

sudo yum install libevent2-devel

请注意,第一个删除了旧版本(1),第二个添加了明确的'2'。幸运的是,机器的类型也可以自动解决。

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.