首页 > 解决方案 > 为什么这个 VLC 媒体播放器构建失败?

问题描述

在 Ubuntu 18 上使用以下配置调用构建 VLC 时:

首先,我像这样获得来源:

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

然后我像这样构建:

make clean

./configure --disable-lua --disable-swscale --disable-alsa --disable-chromecast --disable-fontconfig

构建失败如下:

codec/jpeg.c: In function ‘DecodeBlock’:
codec/jpeg.c:501:16: warning: variable ‘p_row_pointers’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered]
     JSAMPARRAY p_row_pointers = NULL;
                ^~~~~~~~~~~~~~
  CCLD     libjpeg_plugin.la
  CC       codec/libsdl_image_plugin_la-sdl_image.lo
  CCLD     libsdl_image_plugin.la
  CC       codec/libxwd_plugin_la-xwd.lo
  CCLD     libxwd_plugin.la
  CC       codec/liblibass_plugin_la-libass.lo
  CCLD     liblibass_plugin.la
/usr/bin/ld: /root/vlc-3.0.4/contrib/x86_64-linux-gnu/lib/libfontconfig.a(fcxml.o): in function `FcConfigMessage':
/root/vlc-3.0.4/contrib/native/fontconfig/src/fcxml.c:573: undefined reference to `xmlSAX2GetLineNumber'
/usr/bin/ld: /root/vlc-3.0.4/contrib/native/fontconfig/src/fcxml.c:576: undefined reference to `xmlSAX2GetLineNumber'
/usr/bin/ld: /root/vlc-3.0.4/contrib/x86_64-linux-gnu/lib/libfontconfig.a(fcxml.o): in function `IA__FcConfigParseAndLoad':
/root/vlc-3.0.4/contrib/native/fontconfig/src/fcxml.c:3309: undefined reference to `xmlCreatePushParserCtxt'
/usr/bin/ld: /root/vlc-3.0.4/contrib/native/fontconfig/src/fcxml.c:3348: undefined reference to `xmlParseChunk'
/usr/bin/ld: /root/vlc-3.0.4/contrib/native/fontconfig/src/fcxml.c:3362: undefined reference to `xmlFreeParserCtxt'
/usr/bin/ld: /root/vlc-3.0.4/contrib/native/fontconfig/src/fcxml.c:3354: undefined reference to `xmlCtxtGetLastError'

有什么想法我在这里做错了吗?由于我禁用了 fontconfig,因此在这种情况下,似乎有问题的模块应该无法构建。

Libfontconfig 实际上已安装:

root@fuzzbot:~/vlc-3.0.4# apt-get install libfontconfig
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libfontconfig1' instead of 'libfontconfig'
libfontconfig1 is already the newest version (2.13.0-5ubuntu3).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@fuzzbot:~/vlc-3.0.4#

其他想法:

我试图为这种事情找到 VLC 的官方错误跟踪器,但徒劳无功。我为 VLC 的每个子项目找到了错误跟踪器,但我正在尝试构建的主项目。如果有人知道向 VLC 人员询问此问题的适当渠道,请告诉我。

此外,如果管理员觉得这个问题更适合 serverfault 或 AskUbuntu,请随意移动它。据我所知,这对于 serverfault 的包来说有点过于 automake,而且我不认为这个问题是 Ubuntu 独有的,因为官方 VLC wiki 没有为 Ubuntu 指定具体说明。

对于我的用例,我真的不需要所有插件。如果在我的配置调用中做任何进一步的 --disables 会有所帮助,我愿意尝试。

标签: makefilevlcldautomake

解决方案


这些错误表明与“某些”xml 库的链接存在问题。最有可能libxml2,您可能尚未安装。 ./configure应该检测任何丢失的库并防止您的构建失败,但配置脚本本身可能存在错误。

无论如何,由于您使用的是基于 Debian 的发行版,您可以简单地安装构建官方 Debian(或 Ubuntu)软件包所需的所有软件包。(您的个人构建可能有额外的依赖项或缺少一些官方包的依赖项,但这通常是一个很好的起点)。

apt-get build-dep vlc

如果您遇到这样的错误,E: You must put some 'source' URIs in your sources.list您应该将deb-src条目添加到您的 apt 源列表中,例如使用

find /etc/apt/sources.list /etc/apt/sources.list.d/ \
    -type f -name "*.list" -not -name debsrc.list \
    -exec echo sed -e 's|^deb |deb-src |' {} + > /etc/apt/sources.list.d/debsrc.list

推荐阅读