Linux(ubuntu, linuxmint)系统下编译VLC

系统linuxming 19.3,virtualbox machine.

1.基本步骤参考:https://wiki.videolan.org/UnixCompile/

$ git clone git://git.videolan.org/vlc.git
$ cd vlc
$ ./bootstrap

2.安装工具

$ sudo apt-get install git build-essential pkg-config libtool automake autopoint gettext
$ sudo apt-get install lua5.1
$ sudo apt-get install libxcb-shm0-dev libxcb-xv0-dev libxcb-keysyms1-dev libxcb-randr0dev libxcb-composite0-dev

3. 编译第三库

有两种方法:

(1)使用编译好的库,适用于成熟版本,因为这些库一般比较老

$  sudo apt-get build-dep vlc

使用推荐的方法,但需要在 software source 中勾选 source code repositories (ubuntu 在software & updates中勾选 source code,并选择下载地址)

(2)手动编译,适用于新版本

$ apt-get install subversion yasm cvs cmake ragel
$ cd contrib
$ mkdir native
$ cd native
$ ../bootstrap
$ make

4.开始编译

$ ./configure --enable-run-as-root

如果提示qt版本低,需要下载错误提示的高版本的qt,下载地址:https://download.qt.io/archive/qt/,下载完成后安装,假设下载的 5.12.3版本,安装目录为默认目录。

 sudo chmod +x qt-opensource-linux-x64-5.12.3.run
 sudo ./qt-opensource-linux-x64-5.12.3.run
默认安装目录 /opt/Qt5.12.3

指定Qt目录,重新执行configure

$ ./configure --enable-run-as-root PKG_CONFIG_PATH=/opt/Qt5.12.3/5.12.3/gcc_64/lib/pkgconfig

成功后,开始make

$ make

$ sudo make install

5.编译过程中一些错误的解决方案

(1) meson 版本低(安装0.47.0为例)

$ sudo apt-get install python3-pip
$ pip install meson==0.47.0

(2)nasm 版本低

$ curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/2.14.02/nasm-2.14.02.tar.bz2
$ tar xjvf nasm-2.14.04.tar.bz2
$ cd nasm-2.14.01
$ ./autogen.sh
$ ./configure

$ make

$ sudo make install

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章