Open gbardini opened 6 months ago
sdbus-cpp 2.0 has come out and we haven't migrated yet.
fwiw, you can build against the submodule
sdbus-cpp 2.0 has come out and we haven't migrated yet.
fwiw, you can build against the submodule
Which version is needed currently? I just tried sdbus-cpp-2.0.0 and sdbus-cpp-1.6.0 and both gave me
xdg-desktop-portal-hyprland]$ cmake --build build
[ 2%] Building CXX object CMakeFiles/xdg-desktop-portal-hyprland.dir/src/core/PortalManager.cpp.o
In file included from /home/walther/.gitclones/xdg-desktop-portal-hyprland/src/core/../portals/../shared/ScreencopyShared.hpp:13,
from /home/walther/.gitclones/xdg-desktop-portal-hyprland/src/core/../portals/Screencopy.hpp:6,
from /home/walther/.gitclones/xdg-desktop-portal-hyprland/src/core/PortalManager.hpp:8,
from /home/walther/.gitclones/xdg-desktop-portal-hyprland/src/core/PortalManager.cpp:1:
/usr/include/spa-0.2/spa/pod/dynamic.h: In function ‘void spa_pod_dynamic_builder_init(spa_pod_dynamic_builder*, void*, uint32_t, uint32_t)’:
/usr/include/spa-0.2/spa/pod/dynamic.h:45:17: error: either all initializer clauses should be designated or none of them should be
45 | .overflow = spa_pod_dynamic_builder_overflow
| ^
At global scope:
cc1plus: note: unrecognized command-line option ‘-Wno-address-of-temporary’ may have been intended to silence earlier diagnostics
gmake[2]: *** [CMakeFiles/xdg-desktop-portal-hyprland.dir/build.make:116: CMakeFiles/xdg-desktop-portal-hyprland.dir/src/core/PortalManager.cpp.o] Fehler 1
gmake[1]: *** [CMakeFiles/Makefile2:102: CMakeFiles/xdg-desktop-portal-hyprland.dir/all] Fehler 2
gmake: *** [Makefile:136: all] Fehler 2
I got it to work now, by commenting out the line
.overflow = spa_pod_dynamic_builder_overflow
in /usr/include/spa-0.2/spa/pod/dynamic.h
For me I had the same error message (probably different compiler/standard version) but the solution was to remove the .overflow =
part and assign the struct member by order. This line was already uncommented so I simply changed from:
.overflow = spa_pod_dynamic_builder_overflow
to:
spa_pod_dynamic_builder_overflow
For me I had the same error message (probably different compiler/standard version) but the solution was to remove the
.overflow =
part and assign the struct member by order. This line was already uncommented so I simply changed from:.overflow = spa_pod_dynamic_builder_overflow
to:
spa_pod_dynamic_builder_overflow
Nice, that works as well. I meant commenting out instead of uncommenting in my first comment, I don't know much about C or the hyprland source code, so I just removed the line the compile error pointed me to and was happy the error was gone.
OS: Ubuntu 24.04
$ cmake -DCMAKE_INSTALL_LIBEXECDIR=/usr/lib -DCMAKE_INSTALL_PREFIX=/usr -B build -- The C compiler identification is GNU 13.2.0 -- The CXX compiler identification is GNU 13.2.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring XDPH in Release with CMake -- Checking deps... -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success -- Found Threads: TRUE -- Performing Test HAVE_STDATOMIC -- Performing Test HAVE_STDATOMIC - Success -- Found WrapAtomic: TRUE -- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so -- Found WrapOpenGL: TRUE -- Found XKB: /usr/lib/x86_64-linux-gnu/libxkbcommon.so (found suitable version "1.6.0", minimum required is "0.5.0") -- Found WrapVulkanHeaders: /usr/include -- Found PkgConfig: /usr/bin/pkg-config (found version "1.8.1") -- Checking for modules 'wayland-client;wayland-protocols;libpipewire-0.3;libspa-0.2;libdrm;gbm;hyprlang>=0.2.0' -- Found wayland-client, version 1.22.92 -- Found wayland-protocols, version 1.34 -- Found libpipewire-0.3, version 1.0.5 -- Found libspa-0.2, version 0.2 -- Found libdrm, version 2.4.120 -- Found gbm, version 24.0.5-1ubuntu1 -- Found hyprlang, version 0.5.1 -- Checking for module 'sdbus-c++' -- Found sdbus-c++, version 2.0.0 -- Checking for module 'hyprland-protocols' -- Found hyprland-protocols, version 0.2 -- Found WaylandScanner at /usr/bin/wayland-scanner -- Found wayland-protocols at //usr/share/wayland-protocols -- Configuring done (2.1s) -- Generating done (0.0s) -- Build files have been written to: /home/gg/git/xdg-desktop-portal-hyprland/build
$cmake --build build [ 4%] Building CXX object CMakeFiles/xdg-desktop-portal-hyprland.dir/src/core/PortalManager.cpp.o /home/gg/git/xdg-desktop-portal-hyprland/src/core/PortalManager.cpp: In member function ‘void CPortalManager::init()’: /home/gg/git/xdg-desktop-portal-hyprland/src/core/PortalManager.cpp:274:58: error: no matching function for call to ‘createSessionBusConnection(const char [45])’ 274 | nnection = sdbus::createSessionBusConnection("org.freedesktop.impl.portal.desktop.hyprland"); |
~~~~~~~^~~~~~~~~~In file included from /usr/local/include/sdbus-c++/sdbus-c++.h:27, from /home/gg/git/xdg-desktop-portal-hyprland/src/core/PortalManager.hpp:4, from /home/gg/git/xdg-desktop-portal-hyprland/src/core/PortalManager.cpp:1: /usr/local/include/sdbus-c++/IConnection.h:481:55: note: candidate: ‘std::unique_ptr sdbus::createSessionBusConnection()’
481 | scard]] std::unique_ptr createSessionBusConnection();
| ^
~~~~~/usr/local/include/sdbus-c++/IConnection.h:481:55: note: candidate expects 0 arguments, 1 provided /usr/local/include/sdbus-c++/IConnection.h:491:55: note: candidate: ‘std::unique_ptr sdbus::createSessionBusConnection(const ServiceName&)’
491 | scard]] std::unique_ptr createSessionBusConnection(const ServiceName& name);
| ^
~~~~~/usr/local/include/sdbus-c++/IConnection.h:491:101: note: no known conversion for argument 1 from ‘const char [45]’ to ‘const sdbus::ServiceName&’ {aka ‘const sdbus::BusName&’} 491 | n> createSessionBusConnection(const ServiceName& name); |
~~~~~^~/home/gg/git/xdg-desktop-portal-hyprland/src/core/PortalManager.cpp: In member function ‘void CPortalManager::startEventLoop()’: /home/gg/git/xdg-desktop-portal-hyprland/src/core/PortalManager.cpp:439:35: error: ‘class sdbus::IConnection’ has no member named ‘processPendingRequest’; did you mean ‘processPendingEvent’? 439 | while (m_pConnection->processPendingRequest()) { | ^
~~~~| processPendingEvent At global scope: cc1plus: note: unrecognized command-line option ‘-Wno-address-of-temporary’ may have been intended to silence earlier diagnostics gmake[2]: [CMakeFiles/xdg-desktop-portal-hyprland.dir/build.make:76: CMakeFiles/xdg-desktop-portal-hyprland.dir/src/core/PortalManager.cpp.o] Erro 1 gmake[1]: [CMakeFiles/Makefile2:102: CMakeFiles/xdg-desktop-portal-hyprland.dir/all] Erro 2 gmake: *** [Makefile:136: all] Erro 2