GNOME Bugzilla – Bug 685609
Error compiling directfb example
Last modified: 2013-01-07 20:25:57 UTC
I'm having some trouble compiling plugins-bad (0.10.23) because of directfb. This is the actual output of "make": make -C directfb make[4]: se ingresa al directorio `/media/HDD/Proyectos/TINY6410/deps/gst-plugins-bad-0.10.23/tests/examples/directfb' CC gstdfb-gstdfb.o In file included from /usr/include/gstreamer-0.10/gst/gst.h:49:0, from gstdfb.c:39: /usr/include/gstreamer-0.10/gst/gstinfo.h:274:48: error: expected ‘)’ before ‘__attribute__’ /usr/include/gstreamer-0.10/gst/gstinfo.h:274:48: error: expected ‘,’ or ‘;’ before ‘)’ token /usr/include/gstreamer-0.10/gst/gstinfo.h:296:68: error: expected ‘)’ before ‘__attribute__’ /usr/include/gstreamer-0.10/gst/gstinfo.h:296:68: error: expected ‘,’ or ‘;’ before ‘)’ token /usr/include/gstreamer-0.10/gst/gstinfo.h:321:51: error: expected ‘)’ before ‘__attribute__’ /usr/include/gstreamer-0.10/gst/gstinfo.h:321:51: error: expected ‘,’ or ‘;’ before ‘)’ token /usr/include/gstreamer-0.10/gst/gstinfo.h:333:70: error: expected ‘)’ before ‘__attribute__’ /usr/include/gstreamer-0.10/gst/gstinfo.h:333:70: error: expected ‘,’ or ‘;’ before ‘)’ token make[4]: *** [gstdfb-gstdfb.o] Error 1 make[4]: se sale del directorio `/media/HDD/Proyectos/TINY6410/deps/gst-plugins-bad-0.10.23/tests/examples/directfb' make[3]: *** [directfb] Error 2 make[3]: se sale del directorio `/media/HDD/Proyectos/TINY6410/deps/gst-plugins-bad-0.10.23/tests/examples' make[2]: *** [all-recursive] Error 1 make[2]: se sale del directorio `/media/HDD/Proyectos/TINY6410/deps/gst-plugins-bad-0.10.23/tests' make[1]: *** [all-recursive] Error 1 make[1]: se sale del directorio `/media/HDD/Proyectos/TINY6410/deps/gst-plugins-bad-0.10.23' make: *** [all] Error 2 Note that this is just a cut of the entire output. Running "make" inside ext/directfb" throws the same error, but after googling for a while I found a "fix". In ext/directfb/dfb-example.c #include <directfb.h> should be included the last, not the first. (According to http://mandriva.598463.n5.nabble.com/Cooker-tp5708724p5710130.html ) After applying this "fix" I can run "make" inside ext/directfb and stuff gets compiled. Anyways, running "make" globally (aka, from the plugins-bad folder) I get the same error as before. This is happening on an Arch Linux x64 updated this morning. Just for the record, compiling on a Kubuntu 12.04.01 LTS (in a Virtual Box) won't throw that error, e.g., it will compile everything correctly.
We just use GLib's G_GNUC_NO_INSTRUMENT define, which should Just Work. If it doesn't, it's likely a bug somewhere else IMHO. My gmacros.h has: #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4) #define G_GNUC_NO_INSTRUMENT \ __attribute__((__no_instrument_function__)) #else #define G_GNUC_NO_INSTRUMENT #endif which looks ok to me. http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html says "You may also specify attributes with `__' preceding and following each keyword. This allows you to use them in header files without being concerned about a possible macro of the same name. For example, you may use __noreturn__ instead of noreturn.", which is what's done here. So to me it looks like either a gcc/cpp bug (it should ignore the #define __no_instrument_function__ from that directfb header AFAICT), or a bug in the directfb headers, or $somewhere else anyway.
Not sure what's going on here, but looks like a bug somewhere else. Closing for now. Please re-open if you still think it's a bug in GStreamer.
From what I verified, very likely directfb is messing up some of the macros... moving the #include "directfb.h" after #include <gst/gst.h> actually 'works around' the issue... no real fix, but at least it helps building.