zxing: fails to build when using a recent zxing-cpp version (master branch)
Hello,
I tried to build gstreamer 1.18.5 using the master branch of zxing (00783db7aa3bcf8620a301854ac71c0ceaaca0c1), which includes fixes to allow building it using system libraries; unfortunately gst-plugins-bad 1.18.5 fails to build with it:
[...]
[890/1112] Compiling C object tests/check/elements_mpeg4videoparse.p/elements_mpeg4videoparse.c.o
[891/1112] Linking target tests/check/elements_jpeg2000parse
[892/1112] Compiling C object ext/x265/libgstx265.so.p/gstx265enc.c.o
[893/1112] Compiling C object tests/check/elements_mxfmux.p/elements_mxfmux.c.o
[894/1112] Compiling C object tests/check/elements_mpegtsdemux.p/elements_mpegtsdemux.c.o
[895/1112] Compiling C object tests/check/elements_gdpdepay.p/elements_gdpdepay.c.o
[896/1112] Compiling C++ object ext/zxing/libgstzxing.so.p/gstzxing.cpp.o
FAILED: ext/zxing/libgstzxing.so.p/gstzxing.cpp.o
c++ -Iext/zxing/libgstzxing.so.p -Iext/zxing -I../gst-plugins-bad-1.18.5/ext/zxing -I. -I../gst-plugins-bad-1.18.5 -I/gnu/store/l4zh3hgnykfrm0mlqzhf5bg2g5minkqs-glib-2.70.0/include/glib-2.0 -I/gnu/store/l4zh3hgnykfrm0mlqzhf5bg2g5minkqs-glib-2.70.0/lib/glib-2.0/include -I/gnu/store/ma49cgrp0zx5sglkimrbyjw6dzdyjdjv-orc-0.4.32/include/orc-0.4 -I/gnu/store/vd667z4mw6hsay07dh22qyvn3a50k9wg-gstreamer-1.18.5/include/gstreamer-1.0 -I/gnu/store/cykqndb3y2h2y3mdg5v7f347xqn18j4d-gst-plugins-base-1.18.5/include/gstreamer-1.0 -I/gnu/store/kj9bp55vf8wxmhkrlqp0nm5shdzifxw7-zxing-cpp-1.2.0-0.00783db/include/ZXing -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++11 -O2 -g -Wno-non-virtual-dtor -fvisibility=hidden -fno-strict-aliasing -Wformat-nonliteral -Wmissing-declarations -Wredundant-decls -Wwrite-strings -Wformat -Wformat-security -Winit-self -Wmissing-include-dirs -Waddress -Wno-multichar -Wvla -Wpointer-arith -fPIC -pthread -MD -MQ ext/zxing/libgstzxing.so.p/gstzxing.cpp.o -MF ext/zxing/libgstzxing.so.p/gstzxing.cpp.o.d -o ext/zxing/libgstzxing.so.p/gstzxing.cpp.o -c ../gst-plugins-bad-1.18.5/ext/zxing/gstzxing.cpp
../gst-plugins-bad-1.18.5/ext/zxing/gstzxing.cpp: In function ‘GstFlowReturn gst_zxing_transform_frame_ip(GstVideoFilter*, GstVideoFrame*)’:
../gst-plugins-bad-1.18.5/ext/zxing/gstzxing.cpp:330:30: error: invalid initialization of reference of type ‘const ZXing::ImageView&’ from expression of type ‘gint’ {aka ‘int’}
330 | auto result = ReadBarcode (width, height, (unsigned char *) data, width,
| ^~~~~
In file included from ../gst-plugins-bad-1.18.5/ext/zxing/gstzxing.cpp:60:
/gnu/store/kj9bp55vf8wxmhkrlqp0nm5shdzifxw7-zxing-cpp-1.2.0-0.00783db/include/ZXing/ReadBarcode.h:31:37: note: in passing argument 1 of ‘ZXing::Result ZXing::ReadBarcode(const ZXing::ImageView&, const ZXing::DecodeHints&)’
31 | Result ReadBarcode(const ImageView& buffer, const DecodeHints& hints = {});
| ~~~~~~~~~~~~~~~~~^~~~~~
[897/1112] Compiling C object tests/check/elements_pcapparse.p/elements_pcapparse.c.o
../gst-plugins-bad-1.18.5/tests/check/elements/pcapparse.c: In function ‘test_parse_zerosize_frames’:
../gst-plugins-bad-1.18.5/tests/check/elements/pcapparse.c:100:3: warning: ‘g_memdup’ is deprecated: Use 'g_memdup2' instead [-Wdeprecated-declarations]
100 | in_buf = gst_buffer_new_wrapped (g_memdup (zerosize_data, data_size),
| ^~~~~~
In file included from /gnu/store/l4zh3hgnykfrm0mlqzhf5bg2g5minkqs-glib-2.70.0/include/glib-2.0/glib.h:82,
from /gnu/store/vd667z4mw6hsay07dh22qyvn3a50k9wg-gstreamer-1.18.5/include/gstreamer-1.0/gst/gst.h:27,
from /gnu/store/vd667z4mw6hsay07dh22qyvn3a50k9wg-gstreamer-1.18.5/include/gstreamer-1.0/gst/check/gstcheck.h:32,
from ../gst-plugins-bad-1.18.5/tests/check/elements/parser.h:26,
from ../gst-plugins-bad-1.18.5/tests/check/elements/pcapparse.c:1:
/gnu/store/l4zh3hgnykfrm0mlqzhf5bg2g5minkqs-glib-2.70.0/include/glib-2.0/glib/gstrfuncs.h:257:23: note: declared here
257 | gpointer g_memdup (gconstpointer mem,
| ^~~~~~~~
[898/1112] Linking target tests/check/elements_id3mux
[899/1112] Compiling C object tests/check/elements_nvdec.p/elements_nvdec.c.o
[900/1112] Compiling C object tests/check/elements_mxfdemux.p/elements_mxfdemux.c.o
[901/1112] Linking target tests/check/elements_mpeg4videoparse
[902/1112] Linking target ext/x265/libgstx265.so
[903/1112] Compiling C object tests/check/elements_mpegvideoparse.p/elements_mpegvideoparse.c.o
[904/1112] Compiling C object tests/check/elements_gdppay.p/elements_gdppay.c.o
[905/1112] Compiling C object tests/check/elements_mpegtsmux.p/elements_mpegtsmux.c.o
[906/1112] Linking target tests/check/elements_mpegtsdemux
[907/1112] Linking target tests/check/elements_mxfmux
[908/1112] Compiling C object tests/check/elements_nvenc.p/elements_nvenc.c.o
[909/1112] Linking target tests/check/elements_gdpdepay
[910/1112] Compiling C object tests/check/elements_pnm.p/elements_pnm.c.o
[911/1112] Compiling C object tests/check/elements_camerabin.p/elements_camerabin.c.o
[912/1112] Compiling C object tests/check/elements_rtpsrc.p/elements_rtpsrc.c.o
[913/1112] Compiling C object tests/check/elements_rtponvifparse.p/elements_rtponvifparse.c.o
[914/1112] Compiling C object tests/check/elements_h265parse.p/elements_h265parse.c.o
[915/1112] Compiling C object tests/check/elements_rtponviftimestamp.p/elements_rtponviftimestamp.c.o
[916/1112] Compiling C++ object ext/webrtcdsp/libgstwebrtcdsp.so.p/gstwebrtcdsp.cpp.o
[917/1112] Compiling C object tests/check/elements_ristrtpext.p/elements_ristrtpext.c.o
[918/1112] Compiling C object tests/check/elements_hlsdemux_m3u8.p/elements_hlsdemux_m3u8.c.o
[919/1112] Compiling C object ext/webrtc/libgstwebrtc.so.p/gstwebrtcbin.c.o
ninja: build stopped: subcommand failed.
error: in phase 'build': uncaught exception:
%exception #<&invoke-error program: "ninja" arguments: ("-j" "24") exit-status: 1 term-signal: #f stop-signal: #f>
phase `build' failed after 14.0 seconds
command "ninja" "-j" "24" failed with status 1
builder for `/gnu/store/4y3mcc97ibjxpaqvzvlz9mxvxizpzxfr-gst-plugins-bad-1.18.5.drv' failed with exit code 1
build of /gnu/store/4y3mcc97ibjxpaqvzvlz9mxvxizpzxfr-gst-plugins-bad-1.18.5.drv failed
View build log at '/var/log/guix/drvs/4y/3mcc97ibjxpaqvzvlz9mxvxizpzxfr-gst-plugins-bad-1.18.5.drv'.
Thanks!
Edited by Tim-Philipp Müller