Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 775620 - media-gfx/nomacs-3.16.224-r2[-opencv] with gcc10: error: no match for ‘operator<<’ (operand types are ‘std::ostream’ {aka ‘std::basic_ostream<char>’} and ‘const char [2]’)
Summary: media-gfx/nomacs-3.16.224-r2[-opencv] with gcc10: error: no match for ‘operat...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Qt Bug Alias
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: gcc-10
  Show dependency tree
 
Reported: 2021-03-12 10:56 UTC by cpu
Modified: 2022-01-23 17:58 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
full build log on amd64 (nomacs-3-16-224-r2-amd64.log.xz,18.12 KB, application/x-xz)
2021-03-12 10:56 UTC, cpu
Details
compile-as-CXX20-not-CXX11.patch (compile-as-CXX20-not-CXX11.patch,697 bytes, patch)
2021-11-08 15:28 UTC, genBTC
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description cpu 2021-03-12 10:56:57 UTC
Created attachment 690978 [details]
full build log on amd64

When trying to build nomacs with gcc-10.2.0-r5, the build crashes, but it builds normally with gcc-9.3.0-r2. The error is reproducible on x86 and amd64 systems.

emerge --info
Portage 3.0.13 (python 3.8.7-final-0, default/linux/amd64/17.1, gcc-10.2.0, glibc-2.32-r7, 5.4.97-gentoo x86_64)
=================================================================
System uname: Linux-5.4.97-gentoo-x86_64-Intel-R-_Core-TM-_i7-5820K_CPU_@_3.30GHz-with-glibc2.2.5
KiB Mem:    32778720 total,  13706776 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Thu, 11 Mar 2021 00:45:02 +0000
Head commit of repository gentoo: dd62bd2706ef58e8ca718a9b4a6d57a6739f9e33
sh bash 5.0_p18
ld GNU ld (Gentoo 2.35.1 p2) 2.35.1
ccache version 4.1 [disabled]
app-shells/bash:          5.0_p18::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.30.3::gentoo
dev-lang/python:          2.7.18-r6::gentoo, 3.7.9-r2::gentoo, 3.8.7-r1::gentoo, 3.9.1-r1::gentoo
dev-util/ccache:          4.1::gentoo
dev-util/cmake:           3.18.5::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/openrc:          0.42.1-r1::gentoo
sys-apps/sandbox:         2.20::gentoo
sys-devel/autoconf:       2.69-r5::gentoo
sys-devel/automake:       1.16.2-r1::gentoo
sys-devel/binutils:       2.35.1-r1::gentoo
sys-devel/gcc:            10.2.0-r5::gentoo
sys-devel/gcc-config:     2.3.3::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.10::gentoo (virtual/os-headers)
sys-libs/glibc:           2.32-r7::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-max-age: 24
    sync-rsync-extra-opts: 
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-jobs: 1

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=core2 -pipe -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=core2 -pipe -fomit-frame-pointer"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--ask --quiet-build=y --with-bdeps=y --keep-going -j 12 "
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -march=core2 -pipe -fomit-frame-pointer"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -march=core2 -pipe -fomit-frame-pointer"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="C.UTF8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acpi alsa amd64 berkdb bluetooth bzip2 cairo cdda cli crypt cue curl dga djvu dri dts dv dvb dvd egl encode exif expat ffmpeg fftw flac fluidsynth fontconfig fortran gdbm gif gles gles1 gles2 gles3 gme gmp gpm graphviz gstreamer gtk gzip iconv icu javascript jbig jemalloc jpeg jpeg2k lame lcms libglvnd libnotify libtirpc lz4 lzma lzo mad matroska midi mms mng modplug mp3 mp4 mpeg mpg123 mtp multilib musepack ncurses nls nptl ogg openexr opengl openmp opus pam pcre pdf png qt5 quicktime raw readline sdl seccomp sid sndfile speex split-usr ssl startup-notification svg theora threads tiff truetype udev unicode usb v4l vaapi vcd vdpau vorbis wavpack webp wifi wmf x264 xattr xft xml xpm xv zip zlib zstd" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2 sse3 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" L10N="ru en en-GB" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_8" PYTHON_TARGETS="python3_7 python3_8" RUBY_TARGETS="ruby26" USERLAND="GNU" VIDEO_CARDS="fbdev intel i915" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS


build error(the gist is the same for amd64 and x86)

/var/tmp/portage/media-gfx/nomacs-3.16.224-r2/work/nomacs-3.16.224/ImageLounge/src/DkCore/DkMath.h:594:12: error: no match for ‘operator<<’ (operand types are ‘std::ostream’ {aka ‘std::basic_ostream<char>’} and ‘const char [2]’)
  594 |   return s << "[" << x << ", " << y << "]";
      |          ~ ^~ ~~~
      |          |    |
      |          |    const char [2]
      |          std::ostream {aka std::basic_ostream<char>}
Comment 1 Ionen Wolkens gentoo-dev 2021-03-12 12:11:24 UTC
Can re-enable the default USE=opencv as a workaround.
Comment 2 Opportunist 2021-04-28 13:11:40 UTC
same here
Comment 3 genBTC 2021-08-25 05:38:03 UTC
I have this bug too. I was able to solve the problem by changing the build.ninja file from -std=c++11 to -std=c++20 , then it works.
I believe this is due to the interaction with the latest versions of QT and GCC.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-09-23 20:51:42 UTC
ping qt
Comment 5 genBTC 2021-11-08 15:28:37 UTC
Created attachment 749562 [details, diff]
compile-as-CXX20-not-CXX11.patch

This patch modifies CMakeLists.txt enabling C++20 mode and allows compilation to successfully complete!
(users can create a local build repo overlay, put this patch in files/ and just add it to the PATCHES= section in the nomacs .ebuild)

Since C++20 itself by default includes additional warnings, there was WAYYY too much spam for -Wdeprecated-anon-enum-enum-conversion.
So I decided to add -Wno-deprecated-anon-enum-enum-conversion to the patch also because seeing that warning brings zero benefit. It is type-safety paranoia to the extreme.
see: https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/C_002b_002b-Dialect-Options.html#index-Wdeprecated-enum-enum-conversion

There are still a decent amount of -Wdeprecated-declarations in the code, but I believe those are useful to see, and there are less of them so its bearable.

This is my user-provided solution since nobody else is working on this upstream.
It works for me, but YMMV, and it may not be advised to switch the compiler from C++11 to C++20 without the author's blessing? But given the entire thing failed compilation before, and now it succeeds and the program works, I find it a satisfactory workaround.

Enjoy!
Comment 6 nicotroost 2021-11-09 19:00:07 UTC
Same error for me with gcc 11.2.0
Comment 7 gentoolinux 2022-01-23 14:25:39 UTC
Any news on this?
I am having the same issue.
The patch from genBTC works fine for me, too.
Comment 8 Stephan Hartmann (RETIRED) gentoo-dev 2022-01-23 17:33:22 UTC
This error may look a bit obscure, but it is only a missing include. Following fixes it for me:

--- a/src/DkCore/DkMath.h
+++ b/src/DkCore/DkMath.h
@@ -30,6 +30,7 @@
 #pragma warning(push, 0)       // no warnings from includes - begin
 #include <cmath>
 #include <float.h>
+#include <ostream>
 #include <QDebug>
 #include <QPointF>
 #include <QPolygonF>
Comment 9 Larry the Git Cow gentoo-dev 2022-01-23 17:58:08 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3edc3889c88ec28a48c6d3a474705dac18f875eb

commit 3edc3889c88ec28a48c6d3a474705dac18f875eb
Author:     Stephan Hartmann <sultan@gentoo.org>
AuthorDate: 2022-01-23 17:57:28 +0000
Commit:     Stephan Hartmann <sultan@gentoo.org>
CommitDate: 2022-01-23 17:58:01 +0000

    media-gfx/nomacs: fix build error due to missing include
    
    Closes: https://bugs.gentoo.org/775620
    Package-Manager: Portage-3.0.28, Repoman-3.0.3
    Signed-off-by: Stephan Hartmann <sultan@gentoo.org>

 .../files/nomacs-3.16.224-DkMath-ostream.patch     | 24 ++++++++++++++++++++++
 media-gfx/nomacs/nomacs-3.16.224-r2.ebuild         |  7 +++++--
 2 files changed, 29 insertions(+), 2 deletions(-)