Running "g++ --version" gave "[Errno 2] No such file or directory: 'g++'"
pguerin3 opened this issue · 1 comments
pguerin3 commented
Describe the bug
When trying to create an rpm package for Fedora, I run the following as described in HACKING.md
$ rpmbuild -ba rpm/touchegg.spec
Expected behaviour
The previous steps did complete without error:
$ mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
$ tar --exclude='.flatpak-builder' --exclude='.git' --exclude='build' --exclude='com.github.joseexposito.touche.yml' -czvf ~/rpmbuild/SOURCES/touche.tar.gz -C .. touche
Actual behaviour
I get the following error:
Running "g++ --version" gave "[Errno 2] No such file or directory: 'g++'"
Logs
This is the tail of the output to the terminal:
+ export FCFLAGS
+ LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld '
+ export LDFLAGS
+ LT_SYS_LIBRARY_PATH=/usr/lib64:
+ export LT_SYS_LIBRARY_PATH
+ CC=gcc
+ export CC
+ CXX=g++
+ export CXX
+ /usr/bin/meson --buildtype=plain --prefix=/usr --libdir=/usr/lib64 --libexecdir=/usr/libexec --bindir=/usr/bin --sbindir=/usr/sbin --includedir=/usr/include --datadir=/usr/share --mandir=/usr/share/man --infodir=/usr/share/info --localedir=/usr/share/locale --sysconfdir=/etc --localstatedir=/var --sharedstatedir=/var/lib --wrap-mode=nodownload --auto-features=enabled . x86_64-redhat-linux-gnu -Dflatpak=false
The Meson build system
Version: 0.59.1
Source dir: /home/me/rpmbuild/BUILD/touche
Build dir: /home/me/rpmbuild/BUILD/touche/x86_64-redhat-linux-gnu
Build type: native build
Project name: com.github.joseexposito.touche
Project version: 2.0.1
Host machine cpu family: x86_64
Host machine cpu: x86_64
Program gjs found: YES (/bin/gjs)
Program npm found: YES (/bin/npm)
Program node found: YES (/bin/node)
Program g-ir-scanner found: YES (/bin/g-ir-scanner)
Program desktop-file-validate found: YES (/bin/desktop-file-validate)
Program appstream-util found: YES (/bin/appstream-util)
Program glib-compile-schemas found: YES (/bin/glib-compile-schemas)
Program xgettext found: YES (/bin/xgettext)
Executing subproject libtouche
libtouche| Project name: libtouche
libtouche| Project version: 2.0.0
subprojects/libtouche/meson.build:1:0: ERROR: Unknown compiler(s): [['g++']]
The following exception(s) were encountered:
Running "g++ --version" gave "[Errno 2] No such file or directory: 'g++'"
A full log can be found at /home/me/rpmbuild/BUILD/touche/x86_64-redhat-linux-gnu/meson-logs/meson-log.txt
error: Bad exit status from /var/tmp/rpm-tmp.heb6EC (%build)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.heb6EC (%build)
Your environment
- Operating System: Fedora
- Desktop Environment: LXDE
JoseExposito commented
The latest version (v2.x.x) uses GTK 4 and libadwaita. While GTK 4 is available on Fedora, I'm not sure about libadwaita, I'll need to check.
I'd suggest installing from Flathub, as the RPM is not up to date at the moment.
About your problem, you'd need to install a C++ compiler... But you'll get stuck somewhere else:
sudo dnf install gcc-c++