为什么此VLC Media Player构建失败?

时间:2018-12-16 06:45:22

标签: makefile vlc ld automake

在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的官方Bug跟踪程序,但徒劳无功。我发现了VLC的每个子项目的错误跟踪器,但我正在尝试构建的主要项目。如果有人知道向VLC人员询问此问题的适当渠道,请告诉我。

此外,如果管理员认为此问题更适合serverfault或AskUbuntu,请随时提出。据我所知,这是serverfault的特有的自动制作功能,而且我认为问题并不是Ubuntu独有的,因为官方VLC Wiki没有为Ubuntu提供具体说明。

我的用例实际上并不需要所有插件。如果在我的configure调用中做进一步的--disables会有所帮助,我愿意尝试一下。

2 个答案:

答案 0 :(得分:1)

该错误表示与“某些” xml库的链接存在问题。 很可能是libxml2,您可能尚未安装。 ./configure应该能够检测到任何缺少的库并防止构建失败,但是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

答案 1 :(得分:0)

我跟随您的post on vlc forum到此SO帖子。

正如那里的人所建议的那样,libass是问题所在,因此我添加了禁用它的选项。现在,配置命令如下所示:

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

编译继续进行,没有先前的fontconfig错误。但是,它遇到了另一个错误:

....upnp....: undefined reference to `pthread_rwlock_wrlock'

出现了Google搜索another vlc forum thread。人们建议关闭upnp。通过添加以下内容再次对其进行配置:

--disable-upnp

然后遇到另一个错误:

/libavcodec.a(fft.o): relocation R_X86_64_PC32 against symbol `ff_cos_32' can not be used when making a shared object; recompile with -fPIC

另一个Google搜索suggests to turn off chromaprint,添加了另一个选项:

--disable-chromaprint

最终成功完成了!

在本文开头运行long configure命令之前,我还尝试构建3.0.7.1,但是遇到了缺少liveMedia.hh文件的问题。如果其他人也这样做,这是已安装软件包的列表,尽管由于在configure命令行上禁用了一些功能,所以并非所有软件包都是必需的:

      apt-get install git build-essential pkg-config libtool automake autopoint gettext
      apt-get install subversion yasm cvs cmake ragel
      apt-get install gperf
      apt-get install openjdk-8-jre-headless openjdk-8-jdk-headless
      apt-get install ant
      apt-get install python3-pip
      pip3 install  meson
      apt-get install nasm
      apt-get install protobuf-c-compiler
      apt-get install protobuf-compiler
      apt-get install libpthread-stubs0-dev
      apt-get install libasound2-dev liblivemedia-dev  livemedia-utils

摘要

  1. 使用videolan unix compile wiki page作为以下步骤的指南。
  2. 安装支持软件包,如上面的列表所示。
  3. 运行cd contrib && mkdir native && cd native && ../bootstrap && make来构建库。
  4. 运行非常长的configure命令:
 ./configure --disable-libass \
        --disable-lua --disable-swscale --disable-alsa --disable-chromecast --disable-fontconfig \
        --disable-upnp --disable-chromaprint
  1. 运行make
相关问题