Page 1 of 1

October 3rd, 2016: Unable to compile vlc-git

Posted: 03 Oct 2016 08:13
by andrew46
I have been unable to compile vlc git against FFmpeg 3.1.3 with the following error message:

Code: Select all

CCLD libmad_plugin.la CCLD libugly_resampler_plugin.la CCLD libspeex_resampler_plugin.la /home/andrew/vlc_build/vlcdeps/usr/lib/libavutil.a(hwcontext_vaapi.o): In function `vaapi_device_free': /home/andrew/vlc_build/ffmpeg-3.1.3/libavutil/hwcontext_vaapi.c:861: undefined reference to `XCloseDisplay' /home/andrew/vlc_build/vlcdeps/usr/lib/libavutil.a(hwcontext_vaapi.o): In function `vaapi_device_create': /home/andrew/vlc_build/ffmpeg-3.1.3/libavutil/hwcontext_vaapi.c:891: undefined reference to `XOpenDisplay' /home/andrew/vlc_build/ffmpeg-3.1.3/libavutil/hwcontext_vaapi.c:896: undefined reference to `vaGetDisplay' /home/andrew/vlc_build/ffmpeg-3.1.3/libavutil/hwcontext_vaapi.c:903: undefined reference to `XDisplayName' /home/andrew/vlc_build/ffmpeg-3.1.3/libavutil/hwcontext_vaapi.c:893: undefined reference to `XDisplayName' /home/andrew/vlc_build/ffmpeg-3.1.3/libavutil/hwcontext_vaapi.c:917: undefined reference to `vaGetDisplayDRM' /home/andrew/vlc_build/ffmpeg-3.1.3/libavutil/hwcontext_vaapi.c:891: undefined reference to `XOpenDisplay' /home/andrew/vlc_build/ffmpeg-3.1.3/libavutil/hwcontext_vaapi.c:893: undefined reference to `XDisplayName' /home/andrew/vlc_build/ffmpeg-3.1.3/libavutil/hwcontext_vaapi.c:898: undefined reference to `XDisplayName' /home/andrew/vlc_build/vlcdeps/usr/lib/libavutil.a(hwcontext_vdpau.o): In function `vdpau_device_create': /home/andrew/vlc_build/ffmpeg-3.1.3/libavutil/hwcontext_vdpau.c:431: undefined reference to `XOpenDisplay' /home/andrew/vlc_build/ffmpeg-3.1.3/libavutil/hwcontext_vdpau.c:437: undefined reference to `XDisplayString' /home/andrew/vlc_build/ffmpeg-3.1.3/libavutil/hwcontext_vdpau.c:439: undefined reference to `XDefaultScreen' /home/andrew/vlc_build/ffmpeg-3.1.3/libavutil/hwcontext_vdpau.c:439: undefined reference to `vdp_device_create_x11' /home/andrew/vlc_build/ffmpeg-3.1.3/libavutil/hwcontext_vdpau.c:433: undefined reference to `XDisplayName' /home/andrew/vlc_build/vlcdeps/usr/lib/libavutil.a(hwcontext_vdpau.o): In function `vdpau_device_free': /home/andrew/vlc_build/ffmpeg-3.1.3/libavutil/hwcontext_vdpau.c:410: undefined reference to `XCloseDisplay' collect2: error: ld returned 1 exit status Makefile:10286: recipe for target 'libavio_plugin.la' failed make[4]: *** [libavio_plugin.la] Error 1 make[4]: *** Waiting for unfinished jobs.... make[4]: Leaving directory '/home/andrew/vlc_build/vlc/modules' Makefile:18719: recipe for target 'all-recursive' failed make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory '/home/andrew/vlc_build/vlc/modules' Makefile:8352: recipe for target 'all' failed make[2]: *** [all] Error 2 make[2]: Leaving directory '/home/andrew/vlc_build/vlc/modules' Makefile:2283: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory '/home/andrew/vlc_build/vlc' Makefile:2168: recipe for target 'all' failed make: *** [all] Error 2 andrew@athens:~/vlc_build/vlc$
Same issue with FFmpeg directly from git. Thanks for looking at this issue...

Re: October 3rd, 2016: Unable to compile vlc-git

Posted: 03 Oct 2016 17:51
by Rémi Denis-Courmont
This looks like a bug in your FFmpeg build(s).

Re: October 3rd, 2016: Unable to compile vlc-git

Posted: 06 Oct 2016 03:27
by andrew46
Thanks for looking at this issue Rémi. I have tried a few different versions of FFmpeg, different ./configure options etc with no success. It is odd as I have been successfully compiling the development version of vlc under Ubuntu for many years with no great issue.

Anyway I shall persevere, curious to know if anybody else is having this issue?

Re: October 3rd, 2016: Unable to compile vlc-git

Posted: 06 Oct 2016 19:11
by nonzyro
I'm no expert, but...
undefined reference to `XCloseDisplay'
I would imagine that this is an #ifdef or #ifndef related problem, which would lead me to think, "Configuration problems."

Postulation:
The point of failure seems to point to Video Acceleration settings - as suggested by the first error in the Video Accel API function vaapi_device_free().
Now the output says XCloseDisplay() is "undefined". Well, most likely case is the header file is missing, or rather not #include 'd? Why? #if ... #include ... #elif ... #include...#endif ???
Perhaps there's a flag not set correctly??? This is a common cause of things not being "defined" because #ifdef/#ifndef will start a chain of missing header files.
It could be another configuration, but I'm sure whatever it it, this is video accel related.

Sorry I can't help much more, I'm just a hobbyist, but maybe that'll point you in the right direction.

Re: October 3rd, 2016: Unable to compile vlc-git

Posted: 08 Oct 2016 02:37
by andrew46
So I have read up on the FFmpeg build from contrib and modified my build options for FFmpeg. The whole build is based on this guide, which will explain some of the variables used:

http://www.andrews-corner.org/linux/ubuntu/vlc.html

And the whole FFmpeg section is now:

Code: Select all

sudo apt-get -y install libmp3lame-dev zlib1g-dev libgsm1-dev libopenjpeg-dev && \ cd $HOME/vlc_build && \ wget https://www.ffmpeg.org/releases/ffmpeg-3.1.3.tar.bz2 && \ tar xvf ffmpeg-3.1.3.tar.bz2 && cd ffmpeg-3.1.3 && \ if [ "$(uname -m)" = "x86_64" ]; then ARCHOPTS="--enable-pic" else ARCHOPTS="" fi && \ CPPFLAGS="-I$HOME/vlc_build/vlcdeps/usr/include" \ LDFLAGS="-L$HOME/vlc_build/vlcdeps/usr/lib" \ PKG_CONFIG_PATH="$HOME/vlc_build/vlcdeps/usr/lib/pkgconfig" \ ./configure --prefix=$HOME/vlc_build/vlcdeps/usr \ $ARCHOPTS \ --disable-doc \ --disable-encoder=vorbis \ --disable-decoder=opus \ --enable-libgsm \ --enable-libopenjpeg \ --disable-debug \ --disable-avdevice \ --disable-devices \ --disable-avfilter \ --disable-filters \ --disable-protocol=concat \ --disable-bsfs \ --disable-bzlib \ --disable-avresample \ --disable-swresample \ --disable-iconv \ --enable-libfdk-aac \ --enable-libx265 \ --enable-libmp3lame \ --enable-libvpx \ --disable-decoder=libvpx_vp8 \ --disable-decoder=libvpx_vp9 \ --target-os=linux \ --enable-static \ --disable-shared \ --enable-gpl \ --enable-nonfree && \ make -j 8 && make install-libs install-headers && make distclean
So now with a few small exceptions mimics the contrib build method but the same error message persists and vlc compile fail. Running this under Xenial Xerus from Ubuntu....

Re: October 3rd, 2016: Unable to compile vlc-git

Posted: 08 Oct 2016 18:54
by Rémi Denis-Courmont
Still it seems that your libavutil pkg-config file is wrong, which would be a bug the FFmpeg build system.

Re: October 3rd, 2016: Unable to compile vlc-git

Posted: 09 Oct 2016 03:13
by andrew46
Thanks Rémi for pointing me in the right direction. For the moment I have added the extra links manually to libavutil.pc and this allows for a successful compile of the latest git. I will dig a little deeper into FFmpeg itself for the root cause of the problem...