Closed rydymth closed 2 months ago
I've noticed that the build still shows -std=gnu++23
, not sure where it's coming from, but native_handle
is only available from C++26
https://github.com/hyprwm/Hyprland/commit/83a334f97df4389ca30cb63e50317a66a82562b9
Thanks that solved my issue!!!
I've noticed that the build still shows -std=gnu++23, not sure where it's coming from, but native_handle is only available from C++26
Yupp had a similar issue
Used the following and it worked just fine.
export "CXX=/usr/bin/gcc-14 -std=gnu++26"
Closing this issue. Thankyou everyone!
$ export "CXX=/usr/bin/gcc -std=gnu++26"
$ gcc --version
gcc (GCC) 14.1.1 20240701 (Red Hat 14.1.1-7)
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[50/247] Building CXX object hyprpm/CMakeFiles/hyprpm.dir/s[55/247] Linking CXX executable hyprctl/hyprctl
FAILED: hyprctl/hyprctl
: && /usr/bin/gcc -std=gnu++26 -O3 -DNDEBUG -Wl,--export-dynamic -rdynamic hyprctl/CMakeFiles/hyprctl.dir/main.cpp.o -o hyprctl/hyprctl /usr/lib64/libhyprutils.so && :
/usr/bin/ld: hyprctl/CMakeFiles/hyprctl.dir/main.cpp.o: undefined reference to symbol '_ZNKSt6locale4nameB5cxx11Ev@@GLIBCXX_3.4.21'
/usr/bin/ld: /usr/lib64/libstdc++.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
[57/247] Building CXX object...prland.dir/cmake_pch.hxx.gc
ninja: build stopped: subcommand failed.
make[1]: *** [Makefile:15: release] Error 1
make[1]: Leaving directory '/home/acheong/dependencies/Hyprland'
make: *** [Makefile:33: all] Error 2
@acheong08 the instructions aren't quite right, this is trying to build C++ with a C compiler, what worked for me was this:
export CXX=/usr/bin/g++-14
export CXXFLAGS=-std=gnu++26
export CC=/usr/bin/gcc-14
This tells cmake to use gcc 14 for C and C++, and sets the flags properly via their own variable
$ export "CXX=/usr/bin/gcc -std=gnu++26" $ gcc --version gcc (GCC) 14.1.1 20240701 (Red Hat 14.1.1-7) Copyright (C) 2024 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[50/247] Building CXX object hyprpm/CMakeFiles/hyprpm.dir/s[55/247] Linking CXX executable hyprctl/hyprctl FAILED: hyprctl/hyprctl : && /usr/bin/gcc -std=gnu++26 -O3 -DNDEBUG -Wl,--export-dynamic -rdynamic hyprctl/CMakeFiles/hyprctl.dir/main.cpp.o -o hyprctl/hyprctl /usr/lib64/libhyprutils.so && : /usr/bin/ld: hyprctl/CMakeFiles/hyprctl.dir/main.cpp.o: undefined reference to symbol '_ZNKSt6locale4nameB5cxx11Ev@@GLIBCXX_3.4.21' /usr/bin/ld: /usr/lib64/libstdc++.so.6: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status [57/247] Building CXX object...prland.dir/cmake_pch.hxx.gc ninja: build stopped: subcommand failed. make[1]: *** [Makefile:15: release] Error 1 make[1]: Leaving directory '/home/acheong/dependencies/Hyprland' make: *** [Makefile:33: all] Error 2
I solved exactly same problem on Ubuntu24.04 by adding link library stdc++:
target_link_libraries(Hyprland stdc++ m) # CMakeLists.txt
target_link_libraries(hyprpm PUBLIC PkgConfig::deps stdc++ m) # hyprpm/CMakeLists.txt
target_link_libraries(hyprctl PUBLIC PkgConfig::hyprctl_deps stdc++ m) # hyprctl/CMakeLists.txt
Regression?
No
System Info and Version
System/Version info
```shDescription
Build error in ubuntu
Do i need to update any dependencies? Already updated hyprutils and aquamarine to latest.
How to reproduce
On ubuntu system, clone recursively and make all.
Crash reports, logs, images, videos
No response