ubuntu上编译安装x264

1.安装yasm

sudo apt-get install yasm

2.安装git

sudo apt-get install git

3.安装x264

git clone http://git.videolan.org/git/x264.git

cd x264

mkdir build && cd build

../configure --enable-shared

make -j4

sudo make install

4.配置环境

    此时 libx264.so默认安装在/usr/local/lib,直接编译会出现
tmux: error while loading shared libraries: libx264.so.2: cannot open shared object file: No such file or directory
原因就是已经安装了该共享库, 但执行需要调用该共享库的程序的时候, 程序按照默认共享库路径 /usr/lib 找不到该共享库文件.
如果共享库文件安装到了/usr/local/lib(很多开源的共享库都会安装到该目录下)或其它"非/lib或/usr/lib"目录下, 那么在执行
ldconfig命令前, 还要把新共享库目录加入到共享库配置文件/etc/ld.so.conf中, 如下:

su
echo "/usr/local/lib" >> /etc/ld.so.conf
ldconfig
原文地址:https://www.cnblogs.com/ziyu-trip/p/6783165.html