[FFmpeg-devel] [PATCH] Fix undefined reference to xcb_shape_rectangles in xcbgrab.c

Boris Reisig voip at boris.ca
Sun Nov 23 21:48:54 CET 2014

It seems when using the latest ffmpeg from master git, there's an 
incompatible change in the last few weeks that prevents libxcb-shape 
from being detected properly in ffmpeg so it wouldn't compile properly.  
I have written a patch to fix the detection to make ffmpeg compile properly.

Example if if failing to compile.

INSTALL doc/libavcodec.3
INSTALL doc/libavformat.3
INSTALL doc/libavdevice.3
INSTALL doc/libavfilter.3
LD      ffmpeg_g
libavdevice/libavdevice.a(xcbgrab.o): In function `xcbgrab_read_header':
xcbgrab.c:(.text.unlikely+0x52c): undefined reference to 
collect2: error: ld returned 1 exit status
Makefile:122: recipe for target 'ffmpeg_g' failed
make: *** [ffmpeg_g] Error 1

-------------- next part --------------
# This fixes the latest ffmpeg not compiling the latest libxcb with shape support. Boris Reisig <voip at boris.ca>
--- configure-original	2014-11-23 12:45:45.000000000 -0600
+++ configure	2014-11-23 13:39:01.817767733 -0600
@@ -254,6 +254,7 @@
   --enable-libxcb          enable X11 grabbing using XCB [auto]
   --enable-libxcb-shm      enable X11 grabbing shm communication [auto]
   --enable-libxcb-xfixes   enable X11 grabbing mouse rendering [auto]
+  --enable-libxcb-shape    enable X11 grabbing mouse rendering [auto]
   --enable-libxvid         enable Xvid encoding via xvidcore,
                            native MPEG-4/Xvid encoder exists [no]
   --enable-libzmq          enable message passing via libzmq [no]
@@ -1386,6 +1387,7 @@
+    libxcb_shape
@@ -5047,8 +5049,13 @@
             enabled libxcb_xfixes && die "ERROR: libxcb_xfixes not found";
         } && enable libxcb_xfixes; }
-    add_cflags $xcb_cflags $xcb_shm_cflags $xcb_xfixes_cflags
-    add_extralibs $xcb_libs $xcb_shm_libs $xcb_xfixes_libs
+    disabled libxcb_shape || {
+        check_pkg_config xcb-shape xcb/shape.h xcb_shape_get_rectangles || {
+            enabled libxcb_shape && die "ERROR: libxcb_shape not found";
+        } && enable libxcb_shape; }
+    add_cflags $xcb_cflags $xcb_shm_cflags $xcb_xfixes_cflags $xcb_shape_cflags
+    add_extralibs $xcb_libs $xcb_shm_libs $xcb_xfixes_libs $xcb_shape_libs

More information about the ffmpeg-devel mailing list