VLC3编译错误:链接问题与libavutil库

时间:2017-09-26 12:17:51

标签: c ffmpeg compilation linker vlc

我试图在ubuntu15.10中编译VLC3很长一段时间,但仍然没有运气。 我将FFmpeg配置如下:

  

〜/ ffmpeg-3.3.3 $ ./configure --cpu = native --enable-pthreads --enable-bzlib --enable-libdc1394 --enable-libfreetype --enable-frei0r --enable-gnutls - -enable-libgsm --enable-libmp3lame --enable-librtmp --enable-libopencv --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora - -enable-vaapi --enable-vdpau --enable-libvorbis --enable-libvpx --enable-zlib --enable-libfdk-aac --enable-nonfree --enable-gpl --enable-swscale --enable- libcdio --enable-libxcb --enable-libx264 --enable-libxvid --enable-libopencore-amrnb --enable-version3 --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-nvenc --enable -openssl --enable-decklink --extra-cflags = - I/home/ivan/Downloads/Blackmagic_DeckLink_SDK_10.9.5/Linux/include --extra-ldflags = -ldl --extra-libs = -ldl --enable-pic

并使用以下参数配置VLC3:

  

〜/ vlc-3.0.0-git $ ./configure   --with-decklink-sdk = I/home/ivan/Downloads/Blackmagic_DeckLink_SDK_10.9.5/Linux/include --disable-chromecas

编译看起来很好。然后我试了一下:

  

$ sudo make install

并收到以下错误:

  CCLD     libavio_plugin.la
/usr/local/lib/libavutil.a(hwcontext_vaapi.o): In function `vaapi_device_free':
/home/ivan/ffmpeg-3.3.3/libavutil/hwcontext_vaapi.c:899: undefined reference to `XCloseDisplay'
/usr/local/lib/libavutil.a(hwcontext_vaapi.o): In function `vaapi_device_create':
/home/ivan/ffmpeg-3.3.3/libavutil/hwcontext_vaapi.c:929: undefined reference to `XOpenDisplay'
/home/ivan/ffmpeg-3.3.3/libavutil/hwcontext_vaapi.c:934: undefined reference to `vaGetDisplay'
/home/ivan/ffmpeg-3.3.3/libavutil/hwcontext_vaapi.c:941: undefined reference to `XDisplayName'
/home/ivan/ffmpeg-3.3.3/libavutil/hwcontext_vaapi.c:931: undefined reference to `XDisplayName'
/home/ivan/ffmpeg-3.3.3/libavutil/hwcontext_vaapi.c:958: undefined reference to `vaGetDisplayDRM'
/home/ivan/ffmpeg-3.3.3/libavutil/hwcontext_vaapi.c:929: undefined reference to `XOpenDisplay'
/home/ivan/ffmpeg-3.3.3/libavutil/hwcontext_vaapi.c:931: undefined reference to `XDisplayName'
/home/ivan/ffmpeg-3.3.3/libavutil/hwcontext_vaapi.c:936: undefined reference to `XDisplayName'
/usr/local/lib/libavutil.a(hwcontext_vdpau.o): In function `vdpau_device_create':
/home/ivan/ffmpeg-3.3.3/libavutil/hwcontext_vdpau.c:431: undefined reference to `XOpenDisplay'
/home/ivan/ffmpeg-3.3.3/libavutil/hwcontext_vdpau.c:437: undefined reference to `XDisplayString'
/home/ivan/ffmpeg-3.3.3/libavutil/hwcontext_vdpau.c:439: undefined reference to `XDefaultScreen'
/home/ivan/ffmpeg-3.3.3/libavutil/hwcontext_vdpau.c:439: undefined reference to `vdp_device_create_x11'
/home/ivan/ffmpeg-3.3.3/libavutil/hwcontext_vdpau.c:433: undefined reference to `XDisplayName'
/usr/local/lib/libavutil.a(hwcontext_vdpau.o): In function `vdpau_device_free':
/home/ivan/ffmpeg-3.3.3/libavutil/hwcontext_vdpau.c:410: undefined reference to `XCloseDisplay'
collect2: error: ld returned 1 exit status
Makefile:12577: recipe for target 'libavio_plugin.la' failed
make[4]: *** [libavio_plugin.la] Error 1
make[4]: Leaving directory '/home/ivan/vlc-3.0.0-git/modules'
Makefile:25280: recipe for target 'install-recursive' failed
make[3]: *** [install-recursive] Error 1
make[3]: Leaving directory '/home/ivan/vlc-3.0.0-git/modules'
Makefile:25679: recipe for target 'install' failed
make[2]: *** [install] Error 2
make[2]: Leaving directory '/home/ivan/vlc-3.0.0-git/modules'
Makefile:1519: recipe for target 'install-recursive' failed
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory '/home/ivan/vlc-3.0.0-git'
Makefile:1985: recipe for target 'install' failed

我已经看到以下与此情况相关的问题: question1question2question3

正如我从这些问题中理解的那样,我应该在编译命令中将以下库移到最后:

  

-lvdpau -lX11 -lva *

但我仍然不明白移动这些库的位置。
请查看pkg-config命令的输出结果:

  

$ pkg-config --libs libavcodec libavformat libswscale libavutil

     

-L / usr / local / lib -lavformat -lXv -lX11 -lXext -lstdc ++ -lvdpau -lva -lva-x11 -lX11 -lva -lva-drm -lva -lxcb -lxcb-shm -lxcb -lxcb- xfixes -lxcb-render -lxcb-shape -lxcb -lxcb-shape -lxcb -lcdio_paranoia -lcdio_cdda -lcdio -ljack -lasound -ldc1394 -lssl -lcrypto -lxvidcore -lx264 -lvpx -lm -lvpx -lm -lvpx -lm - lvpx -lm -lvorbisenc -lvorbis -logg -lvo-amrwbenc -ltheoraenc -ltheoradec -logg -lspeex -lschroedinger-1.0 -lmpmp -lz -lgmp -lpulse -lopus -lopenjpeg -DOPJ_STATIC / usr / lib / x86_64-linux-gnu / libopencv_calib3d.so -lopencv_calib3d /usr/lib/x86_64-linux-gnu/libopencv_contrib.so -lopencv_contrib /usr/lib/x86_64-linux-gnu/libopencv_core.so -lopencv_core / usr / lib / x86_64-linux-gnu / libopencv_features2d。 so -lopencv_features2d /usr/lib/x86_64-linux-gnu/libopencv_flann.so -lopencv_flann /usr/lib/x86_64-linux-gnu/libopencv_gpu.so -lopencv_gpu /usr/lib/x86_64-linux-gnu/libopencv_highgui.so - lopencv_highgui   /usr/lib/x86_64-linux-gnu/libopencv_imgproc.so -lopencv_imgproc   /usr/lib/x86_64-linux-gnu/libopencv_legacy.so -lopencv_legacy   /usr/lib/x86_64-linux-gnu/libopencv_ml.so-lopencv_ml   /usr/lib/x86_64-linux-gnu/libopencv_objdetect.so-lopencv_objdetect   /usr/lib/x86_64-linux-gnu/libopencv_ocl.so -lopencv_ocl   /usr/lib/x86_64-linux-gnu/libopencv_photo.so -lopencv_photo   /usr/lib/x86_64-linux-gnu/libopencv_stitching.so -lopencv_stitching   /usr/lib/x86_64-linux-gnu/libopencv_superres.so -lopencv_superres   /usr/lib/x86_64-linux-gnu/libopencv_ts.so-lopencv_ts   /usr/lib/x86_64-linux-gnu/libopencv_video.so -lopencv_video   /usr/lib/x86_64-linux-gnu/libopencv_videostab.so -lopencv_videostab   -lopencore-amrwb -lopencore-amrnb -lmp3lame -lgsm -lfreetype -lfdk-aac -lgnutls -lcrystalhd -lm -llzma -lbz2 -lz -pthread -ldl -lavcodec -lXv -lX11 -lXext -lstdc ++ -lvdpau -lva -lva -x11 -lX11 -lva -lva-drm -lva -lxcb -lxcb-shm -lxcb -lxcb-xfixes -lxcb-render -lxcb-shape -lxcb -lxcb-shape -lxcb -lcdio_paranoia -lcdio_cdda -lcdio -ljack -lasound -ldc1394 -lssl -lcrypto -lxvidcore -lx264 -lvpx -lm -lvpx -lm -lvpx -lm -lvpx -lm -lvorbisenc -lvorbis -logg -lvo-amrwbenc -ltheoraenc -ltheoradec -logg -lspeex -lschroedinger-1.0 -lrtmp -lz -lgmp -lpulse -lopus -lopenjpeg -DOPJ_STATIC /usr/lib/x86_64-linux-gnu/libopencv_calib3d.so -lopencv_calib3d   /usr/lib/x86_64-linux-gnu/libopencv_contrib.so-lopencv_contrib   /usr/lib/x86_64-linux-gnu/libopencv_core.so-lopencv_core   /usr/lib/x86_64-linux-gnu/libopencv_features2d.so -lopencv_features2d   /usr/lib/x86_64-linux-gnu/libopencv_flann.so-lopencv_flann   /usr/lib/x86_64-linux-gnu/libopencv_gpu.so -lopencv_gpu   /usr/lib/x86_64-linux-gnu/libopencv_highgui.so -lopencv_highgui   /usr/lib/x86_64-linux-gnu/libopencv_imgproc.so -lopencv_imgproc   /usr/lib/x86_64-linux-gnu/libopencv_legacy.so -lopencv_legacy   /usr/lib/x86_64-linux-gnu/libopencv_ml.so-lopencv_ml   /usr/lib/x86_64-linux-gnu/libopencv_objdetect.so-lopencv_objdetect   /usr/lib/x86_64-linux-gnu/libopencv_ocl.so -lopencv_ocl   /usr/lib/x86_64-linux-gnu/libopencv_photo.so -lopencv_photo   /usr/lib/x86_64-linux-gnu/libopencv_stitching.so -lopencv_stitching   /usr/lib/x86_64-linux-gnu/libopencv_superres.so -lopencv_superres   /usr/lib/x86_64-linux-gnu/libopencv_ts.so-lopencv_ts   /usr/lib/x86_64-linux-gnu/libopencv_video.so -lopencv_video   /usr/lib/x86_64-linux-gnu/libopencv_videostab.so -lopencv_videostab   -lopencore-amrwb -lopencore-amrnb -lmp3lame -lgsm -lfreetype -lfdk-aac -lgnutls -lcrystalhd -lm -llzma -lbz2 -lz -pthread -ldl -lswresample -lm -lswscale -lm -lavutil -lm

结果仅适用于libavutil库:

  

$ pkg-config --libs libavutil

     

-L / usr / local / lib -lavutil -lm

请同时查看我的VLC Makefile

您能指出应该重新排序这些图书馆的地方吗?此外,我的pkg-config输出结果与上述问题的结果不同。任何解决这个问题的建议或链接都​​会有所帮助。

1 个答案:

答案 0 :(得分:1)

所以我使用Vagrant在Ubuntu 16.04 LTS上测试了它,因为15.10默认包存储库不可用

vagrant init bento/ubuntu-16.04
vagrant up && vagrant ssh

解压缩源后,我安装了以下所需的软件包

  

sudo apt install -y yasm frei0r-plugins-dev libghc-gnutls-dev libfdk -aac-dev libfreetype6-dev libgsm1-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libopencv-dev libopenjpeg-dev autoconf automake build-essential libass-dev libfreetype6-dev libsdl2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev pkg-config texinfo wget zlib1g-dev libx264-dev libfdk -aac-dev libopus-dev libvpx-dev librtmp-dev libschroedinger-dev speex libspeex-dev libvo-amrwbenc-dev libxvidcore-dev libcdio-paranoia-dev libbz2-dev lua5.2 liblua5.2-dev liba52-0.7.4 -dev libxcb-composite0-dev libxcb-keysyms1 libxcb-xv0-dev libxcb-xvmc0-dev

然后使用下面的

配置ffmpeg
  

./ configure --cpu = native --enable-pthreads --enable-bzlib --enable-libdc1394 --enable-libfreetype --enable-frei0r --enable-gnutls --enable-libgsm --enable- libmp3lame --enable-librtmp --enable-libopencv --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-vaapi --enable- vdpau --enable-libvorbis --enable-libvpx --enable-zlib --enable-libfdk-aac --enable-nonfree --enable-gpl --enable-swscale --enable-libcdio --enable-libxcb - enable-libx264 --enable-libxvid --enable-libopencore-amrnb --enable-version3 --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-nvenc --enable-openssl --enable-decklink - -extra-cflags = -I / vagrant / decklink / blackmagic / Linux / include --extra-ldflags = -ldl --extra-libs = -ldl --enable-pic - enable-shared

使用make -j4 && make install

编译

使用以下配置VLC

  

./ configure --with-decklink-sdk = I / vagrant / decklink / blackmagic / Linux / include --disable-chromecast --enable-shared --disable-wayland

然后使用make -j4 && make install

进行构建

Compiled VLC