Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error build the project #212

Open
gbardini opened this issue May 13, 2024 · 5 comments
Open

Error build the project #212

gbardini opened this issue May 13, 2024 · 5 comments

Comments

@gbardini
Copy link

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_ptrsdbus::IConnection sdbus::createSessionBusConnection()’
481 | scard]] std::unique_ptrsdbus::IConnection 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_ptrsdbus::IConnection sdbus::createSessionBusConnection(const ServiceName&)’
491 | scard]] std::unique_ptrsdbus::IConnection 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

@vaxerski
Copy link
Member

vaxerski commented May 13, 2024

sdbus-cpp 2.0 has come out and we haven't migrated yet.

fwiw, you can build against the submodule

@Faervan
Copy link

Faervan commented Jul 9, 2024

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

@Faervan
Copy link

Faervan commented Jul 9, 2024

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

@nekiwo
Copy link

nekiwo commented Jul 9, 2024

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

@Faervan
Copy link

Faervan commented Jul 10, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants