Why can't gcc find libevent when building tmux from source?
Try:
DIR="$HOME/.bin-libevent"
./configure CFLAGS="-I$DIR/include" LDFLAGS="-L$DIR/lib"
(I'm sure there must be a better way to configure library paths with autoconf. Usually there is a --with-libevent=dir
option. But here, it seems there is no such option.)
I was having a similar problem and discovered that after running sudo yum install libevent-devel
I was able to successfully make and install tmux.
EDIT: If you are installing this on a Red Hat machine, you will also need to visit the channels selection for your server on the Red Hat Network and add the RHEL Server Optional channel. This will give you access to the -devel packages for libevent (the base and supplementary channels do not provide it).
I had the same issue on RHEL 5.4 and actually found libevent is installed but there is no libevent.so symlink, only the real version of the library:
/usr/lib64/libevent-1.1a.so.1
/usr/lib64/libevent-1.1a.so.1.0.2
So, ln -s /usr/lib64/libevent-1.1a.so.1 /usr/lib64/libevent.so
works pretty well for me without the need to install or alter anything. No idea why RedHat's libevent rpm didn't create the symlink. Maybe a bug to report?
But now, it's complaining for this: error: event.h: No such file or directory
.