【问题标题】:Why does this VLC Media Player Build Fail?为什么这个 VLC 媒体播放器构建失败?
【发布时间】:2019-05-16 22:08:35
【问题描述】:

在 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 会有所帮助,我愿意尝试。

【问题讨论】:

    标签: makefile vlc ld automake


    【解决方案1】:

    这些错误表明与“某些”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
    

    【讨论】:

    • 这样做并没有减轻在根目录或 contribs 中构建的错误。现在在 contribs 中构建一个关于内联问题的新错误:error: inlining failed in call to always_inline ‘memcpy’: target specific option mismatch __NTH (memcpy (void *__restrict __dest, const void *__restrict __src,
    • 好吧,你现在有一个完全不同的错误,原来的问题是关于链接 fontconfig 的特定问题。如果您知道有不同的问题,请提出一个新问题(尽管在您的具体情况下,这也可能是 VLC 的一般问题,您应该去他们的 bugtracker)
    【解决方案2】:

    我关注了您的 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'
    

    谷歌搜索出现了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
    

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

    --disable-chromaprint
    

    终于成功了!

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

          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 --disable-libass \
            --disable-lua --disable-swscale --disable-alsa --disable-chromecast --disable-fontconfig \
            --disable-upnp --disable-chromaprint
    
    1. 运行make

    【讨论】:

    • 请注意,上述方法最终在 vlc 3.0.8 上成功。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多