hyprwm / xdg-desktop-portal-hyprland

xdg-desktop-portal backend for Hyprland
BSD 3-Clause "New" or "Revised" License
273 stars 47 forks source link

Build fails from sdbus' `error: call of overloaded ‘Struct(std::tuple<double, double, double>)’ is ambiguous` #257

Closed Opposite34 closed 2 weeks ago

Opposite34 commented 2 weeks ago
../src/portals/Screenshot.cpp: In function ‘void pickHyprPicker(sdbus::MethodCall&)’:
../src/portals/Screenshot.cpp:44:81: error: class template argument deduction failed:
   44 |     results["color"] = sdbus::Struct(std::tuple{r / 255.0, g / 255.0, b / 255.0});
      |                                                                                 ^
../src/portals/Screenshot.cpp:44:81: error: call of overloaded ‘Struct(std::tuple<double, double, double>)’ is ambiguous
In file included from /usr/include/sdbus-c++/ConvenienceApiClasses.h:32,
...

First of all, I have no idea how to do c++ (I'm just debugging why the AUR -git repo failed) so I'm not sure why this error happens. I have tried following the readme, which results in the same error. I have also tried using meson to build which also fails for this same reason.

According to pacman, I have sdbus-cpp version 1.5.0 in my system. Not sure if I need a specific version of it instead or not.

vaxerski commented 2 weeks ago

1.6.0 needed

Opposite34 commented 2 weeks ago

Okay I have now installed sdbus-cpp 1.6.0 (I had to edit the arch extra's PKGBUILD as this version is nowhere to be found in any arch repo(?)) as also reported by cmake here:

❯ cmake -DCMAKE_INSTALL_LIBEXECDIR=/usr/lib -DCMAKE_INSTALL_PREFIX=/usr -B build   
-- Configuring XDPH in Release with CMake
-- Checking deps...
-- Checking for module 'sdbus-c++'
--   Found sdbus-c++, version 1.6.0
-- Found WaylandScanner at /sbin/wayland-scanner
-- Found wayland-protocols at //usr/share/wayland-protocols
-- Configuring done (0.2s)
-- Generating done (0.0s)
-- Build files have been written to: ./xdg-desktop-portal-hyprland/build

However the same error still occurs:

❯ cmake --build build
...
./xdg-desktop-portal-hyprland/src/portals/Screenshot.cpp:44:81: error: class template argument deduction failed:
   44 |     results["color"] = sdbus::Struct(std::tuple{r / 255.0, g / 255.0, b / 255.0});
      |                                                                                 ^
./xdg-desktop-portal-hyprland/src/portals/Screenshot.cpp:44:81: error: call of overloaded ‘Struct(std::tuple<double, double, double>)’ is ambiguous
In file included from /usr/include/sdbus-c++/ConvenienceApiClasses.h:32,
                 from /usr/include/sdbus-c++/IObject.h:30,
                 from /usr/include/sdbus-c++/sdbus-c++.h:28,
                 from ./xdg-desktop-portal-hyprland/src/portals/Screenshot.hpp:3,
                 from ./xdg-desktop-portal-hyprland/src/portals/Screenshot.cpp:1:
...