wzyy2 / gstreamer-opencv

opencv + gstreamer simple demo
130 stars 43 forks source link

How to fix the compile error such as " note: in expansion of macro" ? #5

Closed baiyunyouyou closed 6 years ago

baiyunyouyou commented 6 years ago

firefly@firefly:~/gstreamer-opencv$ make arm-linux-gnueabihf-g++ -pthread -I/usr/include/gstreamer-1.0 -I/usr/lib/aarch64-linux-gnu/gstreamer-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include -lgstreamer-1.0 -lgobject-2.0 -lglib-2.0 -I/usr/include/opencv /usr/lib/aarch64-linux-gnu/libopencv_calib3d.so -lopencv_calib3d /usr/lib/aarch64-linux-gnu/libopencv_contrib.so -lopencv_contrib /usr/lib/aarch64-linux-gnu/libopencv_core.so -lopencv_core /usr/lib/aarch64-linux-gnu/libopencv_features2d.so -lopencv_features2d /usr/lib/aarch64-linux-gnu/libopencv_flann.so -lopencv_flann /usr/lib/aarch64-linux-gnu/libopencv_gpu.so -lopencv_gpu /usr/lib/aarch64-linux-gnu/libopencv_highgui.so -lopencv_highgui /usr/lib/aarch64-linux-gnu/libopencv_imgproc.so -lopencv_imgproc /usr/lib/aarch64-linux-gnu/libopencv_legacy.so -lopencv_legacy /usr/lib/aarch64-linux-gnu/libopencv_ml.so -lopencv_ml /usr/lib/aarch64-linux-gnu/libopencv_objdetect.so -lopencv_objdetect /usr/lib/aarch64-linux-gnu/libopencv_ocl.so -lopencv_ocl /usr/lib/aarch64-linux-gnu/libopencv_photo.so -lopencv_photo /usr/lib/aarch64-linux-gnu/libopencv_stitching.so -lopencv_stitching /usr/lib/aarch64-linux-gnu/libopencv_superres.so -lopencv_superres /usr/lib/aarch64-linux-gnu/libopencv_ts.so -lopencv_ts /usr/lib/aarch64-linux-gnu/libopencv_video.so -lopencv_video /usr/lib/aarch64-linux-gnu/libopencv_videostab.so -lopencv_videostab -c Main.cpp -o Main.o In file included from /usr/lib/aarch64-linux-gnu/glib-2.0/include/glibconfig.h:9:0, from /usr/include/glib-2.0/glib/gtypes.h:32, from /usr/include/glib-2.0/glib/galloca.h:32, from /usr/include/glib-2.0/glib.h:30, from /usr/include/gstreamer-1.0/gst/gst.h:27, from /usr/include/gstreamer-1.0/gst/allocators/gstdmabuf.h:24, from Common.h:6, from Main.cpp:1: /usr/include/glib-2.0/glib/gtypes.h: In function ‘gboolean _GLIB_CHECKED_ADD_U64(guint64*, guint64, guint64)’: /usr/include/glib-2.0/glib/gmacros.h:142:29: error: size of array ‘_GStaticAssertCompileTimeAssertion_0’ is negative attribute((unused)) ^ /usr/include/glib-2.0/glib/gmacros.h:232:120: note: in expansion of macro ‘G_GNUC_UNUSED’

define G_STATIC_ASSERT(expr) typedef char G_PASTE (GStaticAssertCompileTimeAssertion, COUNTER)[(expr) ? 1 : -1] G_GNUC_UNUSED

                                                                                                                    ^

/usr/include/glib-2.0/glib/gtypes.h:422:3: note: in expansion of macro ‘G_STATIC_ASSERT’ G_STATIC_ASSERT(sizeof (unsigned long long) == sizeof (guint64)); ^ In file included from /usr/include/gstreamer-1.0/gst/gst.h:86:0, from /usr/include/gstreamer-1.0/gst/allocators/gstdmabuf.h:24, from Common.h:6, from Main.cpp:1: /usr/include/gstreamer-1.0/gst/gstutils.h: In function ‘guint64 __gst_slow_read64_be(const guint8)’: /usr/include/gstreamer-1.0/gst/gstutils.h:111:72: warning: left shift count >= width of type [-Wshift-count-overflow] (((guint##__size) (((const guint8 ) (data))[idx])) << (__shift)) ^ /usr/include/gstreamer-1.0/gst/gstutils.h:164:36: note: in expansion of macro ‘_GST_GET’

define _GST_READ_UINT64_BE(data) (_GST_GET (data, 0, 64, 56) | \

                                ^

/usr/include/gstreamer-1.0/gst/gstutils.h:184:10: note: in expansion of macro ‘_GST_READ_UINT64_BE’ return _GST_READ_UINT64_BE (data); ^ /usr/include/gstreamer-1.0/gst/gstutils.h:111:72: warning: left shift count >= width of type [-Wshift-count-overflow] (((guint##size) (((const guint8 *) (data))[idx])) << (shift)) ^ /usr/include/gstreamer-1.0/gst/gstutils.h:165:7: note: in expansion of macro ‘_GST_GET’ _GST_GET (data, 1, 64, 48) | \ ^ /usr/include/gstreamer-1.0/gst/gstutils.h:184:10: note: in expansion of macro ‘_GST_READ_UINT64_BE’ return _GST_READ_UINT64_BE (data); ^ /usr/include/gstreamer-1.0/gst/gstutils.h:111:72: warning: left shift count >= width of type [-Wshift-count-overflow] (((guint##size) (((const guint8 *) (data))[idx])) << (shift)) ^ /usr/include/gstreamer-1.0/gst/gstutils.h:166:7: note: in expansion of macro ‘_GST_GET’ _GST_GET (data, 2, 64, 40) | \ ^ /usr/include/gstreamer-1.0/gst/gstutils.h:184:10: note: in expansion of macro ‘_GST_READ_UINT64_BE’ return _GST_READ_UINT64_BE (data); ^ /usr/include/gstreamer-1.0/gst/gstutils.h:111:72: warning: left shift count >= width of type [-Wshift-count-overflow] (((guint##size) (((const guint8 *) (data))[idx])) << (shift)) ^ /usr/include/gstreamer-1.0/gst/gstutils.h:167:7: note: in expansion of macro ‘_GST_GET’ _GST_GET (data, 3, 64, 32) | \ ^ /usr/include/gstreamer-1.0/gst/gstutils.h:184:10: note: in expansion of macro ‘_GST_READ_UINT64_BE’ return _GST_READ_UINT64_BE (data); ^ /usr/include/gstreamer-1.0/gst/gstutils.h: In function ‘guint64 __gst_slow_read64_le(const guint8)’: /usr/include/gstreamer-1.0/gst/gstutils.h:111:72: warning: left shift count >= width of type [-Wshift-count-overflow] (((guint##__size) (((const guint8 ) (data))[idx])) << (__shift)) ^ /usr/include/gstreamer-1.0/gst/gstutils.h:173:36: note: in expansion of macro ‘_GST_GET’

define _GST_READ_UINT64_LE(data) (_GST_GET (data, 7, 64, 56) | \

                                ^

/usr/include/gstreamer-1.0/gst/gstutils.h:188:10: note: in expansion of macro ‘_GST_READ_UINT64_LE’ return _GST_READ_UINT64_LE (data); ^ /usr/include/gstreamer-1.0/gst/gstutils.h:111:72: warning: left shift count >= width of type [-Wshift-count-overflow] (((guint##size) (((const guint8 *) (data))[idx])) << (shift)) ^ /usr/include/gstreamer-1.0/gst/gstutils.h:174:7: note: in expansion of macro ‘_GST_GET’ _GST_GET (data, 6, 64, 48) | \ ^ /usr/include/gstreamer-1.0/gst/gstutils.h:188:10: note: in expansion of macro ‘_GST_READ_UINT64_LE’ return _GST_READ_UINT64_LE (data); ^ /usr/include/gstreamer-1.0/gst/gstutils.h:111:72: warning: left shift count >= width of type [-Wshift-count-overflow] (((guint##size) (((const guint8 *) (data))[idx])) << (shift)) ^ /usr/include/gstreamer-1.0/gst/gstutils.h:175:7: note: in expansion of macro ‘_GST_GET’ _GST_GET (data, 5, 64, 40) | \ ^ /usr/include/gstreamer-1.0/gst/gstutils.h:188:10: note: in expansion of macro ‘_GST_READ_UINT64_LE’ return _GST_READ_UINT64_LE (data); ^ /usr/include/gstreamer-1.0/gst/gstutils.h:111:72: warning: left shift count >= width of type [-Wshift-count-overflow] (((guint##size) (((const guint8 *) (data))[idx])) << (shift)) ^ /usr/include/gstreamer-1.0/gst/gstutils.h:176:7: note: in expansion of macro ‘_GST_GET’ _GST_GET (data, 4, 64, 32) | \ ^ /usr/include/gstreamer-1.0/gst/gstutils.h:188:10: note: in expansion of macro ‘_GST_READ_UINT64_LE’ return _GST_READ_UINT64_LE (data); ^ In file included from /usr/include/glib-2.0/glib/galloca.h:32:0, from /usr/include/glib-2.0/glib.h:30, from /usr/include/gstreamer-1.0/gst/gst.h:27, from /usr/include/gstreamer-1.0/gst/allocators/gstdmabuf.h:24, from Common.h:6, from Main.cpp:1: /usr/include/gstreamer-1.0/gst/gstutils.h: In function ‘gdouble GDOUBLE_SWAP_LE_BE(gdouble)’: /usr/include/glib-2.0/glib/gtypes.h:163:56: warning: left shift count >= width of type [-Wshift-count-overflow] (guint64) G_GINT64_CONSTANT (0x00000000000000ffU)) << 56) | \ ^ /usr/include/glib-2.0/glib/gtypes.h:330:36: note: in expansion of macro ‘GUINT64_SWAP_LE_BE_CONSTANT’

define GUINT64_SWAP_LE_BE(val) (GUINT64_SWAP_LE_BE_CONSTANT (val))

                                ^

/usr/include/gstreamer-1.0/gst/gstutils.h:486:9: note: in expansion of macro ‘GUINT64_SWAP_LE_BE’ u.i = GUINT64_SWAP_LE_BE (u.i); ^ /usr/include/glib-2.0/glib/gtypes.h:165:56: warning: left shift count >= width of type [-Wshift-count-overflow] (guint64) G_GINT64_CONSTANT (0x000000000000ff00U)) << 40) | \ ^ /usr/include/glib-2.0/glib/gtypes.h:330:36: note: in expansion of macro ‘GUINT64_SWAP_LE_BE_CONSTANT’

define GUINT64_SWAP_LE_BE(val) (GUINT64_SWAP_LE_BE_CONSTANT (val))

                                ^

/usr/include/gstreamer-1.0/gst/gstutils.h:486:9: note: in expansion of macro ‘GUINT64_SWAP_LE_BE’ u.i = GUINT64_SWAP_LE_BE (u.i); ^ /usr/include/glib-2.0/glib/gtypes.h:175:56: warning: right shift count >= width of type [-Wshift-count-overflow] (guint64) G_GINT64_CONSTANT (0x00ff000000000000U)) >> 40) | \ ^ /usr/include/glib-2.0/glib/gtypes.h:330:36: note: in expansion of macro ‘GUINT64_SWAP_LE_BE_CONSTANT’

define GUINT64_SWAP_LE_BE(val) (GUINT64_SWAP_LE_BE_CONSTANT (val))

                                ^

/usr/include/gstreamer-1.0/gst/gstutils.h:486:9: note: in expansion of macro ‘GUINT64_SWAP_LE_BE’ u.i = GUINT64_SWAP_LE_BE (u.i); ^ /usr/include/glib-2.0/glib/gtypes.h:177:56: warning: right shift count >= width of type [-Wshift-count-overflow] (guint64) G_GINT64_CONSTANT (0xff00000000000000U)) >> 56))) ^ /usr/include/glib-2.0/glib/gtypes.h:330:36: note: in expansion of macro ‘GUINT64_SWAP_LE_BE_CONSTANT’

define GUINT64_SWAP_LE_BE(val) (GUINT64_SWAP_LE_BE_CONSTANT (val))

                                ^

/usr/include/gstreamer-1.0/gst/gstutils.h:486:9: note: in expansion of macro ‘GUINT64_SWAP_LE_BE’ u.i = GUINT64_SWAP_LE_BE (u.i); ^ In file included from /usr/include/gstreamer-1.0/gst/gst.h:86:0, from /usr/include/gstreamer-1.0/gst/allocators/gstdmabuf.h:24, from Common.h:6, from Main.cpp:1: /usr/include/gstreamer-1.0/gst/gstutils.h: In function ‘void GST_WRITE_DOUBLE_LE(guint8, gdouble)’: /usr/include/gstreamer-1.0/gst/gstutils.h:114:75: warning: right shift count >= width of type [-Wshift-count-overflow] (((guint8 ) (data))[idx] = (((guint##size) (num)) >> (shift)) & 0xff) ^ /usr/include/gstreamer-1.0/gst/gstutils.h:341:43: note: in expansion of macro ‘_GST_PUT’ _GST_PUT (put_data, 4, 64, 32, num); \ ^ /usr/include/gstreamer-1.0/gst/gstutils.h:712:3: note: in expansion of macro ‘GST_WRITE_UINT64_LE’ GST_WRITE_UINT64_LE (data, u.i); ^ /usr/include/gstreamer-1.0/gst/gstutils.h:114:75: warning: right shift count >= width of type [-Wshift-count-overflow] (((guint8 ) (data))[idx] = (((guint##size) (num)) >> (shift)) & 0xff) ^ /usr/include/gstreamer-1.0/gst/gstutils.h:342:43: note: in expansion of macro ‘_GST_PUT’ _GST_PUT (put_data, 5, 64, 40, num); \ ^ /usr/include/gstreamer-1.0/gst/gstutils.h:712:3: note: in expansion of macro ‘GST_WRITE_UINT64_LE’ GST_WRITE_UINT64_LE (data, u.i); ^ /usr/include/gstreamer-1.0/gst/gstutils.h:114:75: warning: right shift count >= width of type [-Wshift-count-overflow] (((guint8 ) (data))[idx] = (((guint##size) (num)) >> (shift)) & 0xff) ^ /usr/include/gstreamer-1.0/gst/gstutils.h:343:43: note: in expansion of macro ‘_GST_PUT’ _GST_PUT (put_data, 6, 64, 48, num); \ ^ /usr/include/gstreamer-1.0/gst/gstutils.h:712:3: note: in expansion of macro ‘GST_WRITE_UINT64_LE’ GST_WRITE_UINT64_LE (data, u.i); ^ /usr/include/gstreamer-1.0/gst/gstutils.h:114:75: warning: right shift count >= width of type [-Wshift-count-overflow] (((guint8 ) (data))[idx] = (((guint##size) (num)) >> (shift)) & 0xff) ^ /usr/include/gstreamer-1.0/gst/gstutils.h:344:43: note: in expansion of macro ‘_GST_PUT’ _GST_PUT (put_data, 7, 64, 56, num); \ ^ /usr/include/gstreamer-1.0/gst/gstutils.h:712:3: note: in expansion of macro ‘GST_WRITE_UINT64_LE’ GST_WRITE_UINT64_LE (data, u.i); ^ /usr/include/gstreamer-1.0/gst/gstutils.h: In function ‘void GST_WRITE_DOUBLE_BE(guint8, gdouble)’: /usr/include/gstreamer-1.0/gst/gstutils.h:114:75: warning: right shift count >= width of type [-Wshift-count-overflow] (((guint8 ) (data))[idx] = (((guint##size) (num)) >> (shift)) & 0xff) ^ /usr/include/gstreamer-1.0/gst/gstutils.h:318:43: note: in expansion of macro ‘_GST_PUT’ _GST_PUT (put_data, 0, 64, 56, num); \ ^ /usr/include/gstreamer-1.0/gst/gstutils.h:732:3: note: in expansion of macro ‘GST_WRITE_UINT64_BE’ GST_WRITE_UINT64_BE (data, u.i); ^ /usr/include/gstreamer-1.0/gst/gstutils.h:114:75: warning: right shift count >= width of type [-Wshift-count-overflow] (((guint8 ) (data))[idx] = (((guint##size) (num)) >> (shift)) & 0xff) ^ /usr/include/gstreamer-1.0/gst/gstutils.h:319:43: note: in expansion of macro ‘_GST_PUT’ _GST_PUT (put_data, 1, 64, 48, num); \ ^ /usr/include/gstreamer-1.0/gst/gstutils.h:732:3: note: in expansion of macro ‘GST_WRITE_UINT64_BE’ GST_WRITE_UINT64_BE (data, u.i); ^ /usr/include/gstreamer-1.0/gst/gstutils.h:114:75: warning: right shift count >= width of type [-Wshift-count-overflow] (((guint8 ) (data))[idx] = (((guint##size) (num)) >> (shift)) & 0xff) ^ /usr/include/gstreamer-1.0/gst/gstutils.h:320:43: note: in expansion of macro ‘_GST_PUT’ _GST_PUT (put_data, 2, 64, 40, num); \ ^ /usr/include/gstreamer-1.0/gst/gstutils.h:732:3: note: in expansion of macro ‘GST_WRITE_UINT64_BE’ GST_WRITE_UINT64_BE (data, u.i); ^ /usr/include/gstreamer-1.0/gst/gstutils.h:114:75: warning: right shift count >= width of type [-Wshift-count-overflow] (((guint8 ) (data))[idx] = (((guint##size) (num)) >> (shift)) & 0xff) ^ /usr/include/gstreamer-1.0/gst/gstutils.h:321:43: note: in expansion of macro ‘_GST_PUT’ _GST_PUT (put_data, 3, 64, 32, num); \ ^ /usr/include/gstreamer-1.0/gst/gstutils.h:732:3: note: in expansion of macro ‘GST_WRITE_UINT64_BE’ GST_WRITE_UINT64_BE (data, u.i); ^ makefile:32: recipe for target 'Main.o' failed make: *** [Main.o] Error 1