Skip to content

Commit

Permalink
Installation: recommend Clang 16 for best libc++ compatibility
Browse files Browse the repository at this point in the history
clang < 16 fails with libc++ >= 16:

  In file included from ../src/protocols/GlobalShortcuts.cpp:1:
  In file included from ../src/managers/../protocols/GlobalShortcuts.hpp:2:
  In file included from ../src/managers/../plugins/../defines.hpp:1:
  In file included from ../src/helpers/../includes.hpp:19:
  In file included from /usr/include/c++/v1/mutex:191:
  In file included from /usr/include/c++/v1/__memory/shared_ptr.h:31:
  /usr/include/c++/v1/__memory/unique_ptr.h:686:30: error: no matching constructor for initialization of 'SShortcutClient'
    return unique_ptr<_Tp>(new _Tp(_VSTD::forward<_Args>(__args)...));
			       ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ../src/protocols/GlobalShortcuts.cpp:56:34: note: in instantiation of function template specialization 'std::make_unique<SShortcutClient, wl_client *&>' requested here
      m_vClients.emplace_back(std::make_unique<SShortcutClient>(client));
				   ^
  ../src/managers/../protocols/GlobalShortcuts.hpp:12:8: note: candidate constructor (the implicit copy constructor) not viable: cannot convert argument of incomplete type 'wl_client *' to 'const SShortcutClient' for 1st argument
  struct SShortcutClient {
	 ^
  ../src/managers/../protocols/GlobalShortcuts.hpp:12:8: note: candidate constructor (the implicit move constructor) not viable: cannot convert argument of incomplete type 'wl_client *' to 'SShortcutClient' for 1st argument
  ../src/managers/../protocols/GlobalShortcuts.hpp:12:8: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided

clang >= 16 fails with libc++ < 16:

  ../hyprctl/main.cpp:272:12: error: no member named 'all_of' in namespace 'std::ranges'; did you mean 'std::all_of'?
      return std::ranges::all_of(str.begin(), str.end(), [&](char c) { return isdigit(c) != 0 || c == '-' || (allowfloat && c == '.'); });
	     ^~~~~~~~~~~~~~~~~~~
	     std::all_of
  ../src/plugins/PluginSystem.cpp:118:44: error: no member named 'views' in namespace 'std'
      for (auto& p : m_vLoadedPlugins | std::views::reverse)
					~~~~~^
  ../src/layout/MasterLayout.cpp:181:51: error: no member named 'views' in namespace 'std'
	  for (auto& nd : m_lMasterNodesData | std::views::reverse) {
					       ~~~~~^
  ../src/layout/MasterLayout.cpp:1013:55: error: no member named 'views' in namespace 'std'
	      for (auto& nd : m_lMasterNodesData | std::views::reverse) {
						   ~~~~~^
  ../src/config/ConfigManager.cpp:1683:26: error: no member named 'any_of' in namespace 'std::ranges'
	  if (std::ranges::any_of(PIDs, [&](const auto& pid) { return pid == er.iPid; })) {
	      ~~~~~~~~~~~~~^
  ../src/config/ConfigManager.cpp:1691:108: error: no member named 'any_of' in namespace 'std::ranges'
						  [&](const SExecRequestedRule& other) { return std::ranges::any_of(PIDs, [&](const auto& pid) { return pid == other.iPid; }); }));
												~~~~~~~~~~~~~^
  ../src/managers/AnimationManager.cpp:11:57: error: no member named 'any_of' in namespace 'std::ranges'
      if (g_pCompositor->m_bSessionActive && std::ranges::any_of(g_pCompositor->m_vMonitors, [](const auto& mon) { return mon->m_bEnabled && mon->output; })) {
					     ~~~~~~~~~~~~~^
  ../src/protocols/Screencopy.cpp:135:46: error: no member named 'any_of' in namespace 'std::ranges'
      const bool FRAMEAWAITING  = std::ranges::any_of(g_pProtocolManager->m_pScreencopyProtocolManager->m_lFrames, [&](const auto& frame) { return frame.client == this; }) ||
				  ~~~~~~~~~~~~~^
  ../src/protocols/Screencopy.cpp:136:22: error: no member named 'any_of' in namespace 'std::ranges'
	  std::ranges::any_of(g_pProtocolManager->m_pToplevelExportProtocolManager->m_lFrames, [&](const auto& frame) { return frame.client == this; });
	  ~~~~~~~~~~~~~^
  ../src/managers/input/InputManager.cpp:219:57: error: no member named 'views' in namespace 'std'
	  for (auto& w : g_pCompositor->m_vWindows | std::views::reverse) {
						     ~~~~~^
  ../src/Compositor.cpp:547:42: error: no member named 'views' in namespace 'std'
	  for (auto& w : m_vWindows | std::views::reverse) {
				      ~~~~~^
  ../src/Compositor.cpp:563:38: error: no member named 'views' in namespace 'std'
      for (auto& w : m_vWindows | std::views::reverse) {
				  ~~~~~^
  ../src/Compositor.cpp:570:38: error: no member named 'views' in namespace 'std'
      for (auto& w : m_vWindows | std::views::reverse) {
				  ~~~~~^
  ../src/Compositor.cpp:615:42: error: no member named 'views' in namespace 'std'
	  for (auto& w : m_vWindows | std::views::reverse) {
				      ~~~~~^
  ../src/Compositor.cpp:632:38: error: no member named 'views' in namespace 'std'
      for (auto& w : m_vWindows | std::views::reverse) {
				  ~~~~~^
  ../src/Compositor.cpp:647:38: error: no member named 'views' in namespace 'std'
      for (auto& w : m_vWindows | std::views::reverse) {
				  ~~~~~^
  ../src/Compositor.cpp:694:42: error: no member named 'views' in namespace 'std'
	  for (auto& w : m_vWindows | std::views::reverse) {
				      ~~~~~^
  ../src/Compositor.cpp:709:38: error: no member named 'views' in namespace 'std'
      for (auto& w : m_vWindows | std::views::reverse) {
				  ~~~~~^
  ../src/Compositor.cpp:716:38: error: no member named 'views' in namespace 'std'
      for (auto& w : m_vWindows | std::views::reverse) {
				  ~~~~~^
  ../src/Compositor.cpp:733:38: error: no member named 'views' in namespace 'std'
      for (auto& w : m_vWindows | std::views::reverse) {
				  ~~~~~^
  ../src/Compositor.cpp:739:38: error: no member named 'views' in namespace 'std'
      for (auto& w : m_vWindows | std::views::reverse) {
				  ~~~~~^
  ../src/Compositor.cpp:994:43: error: no member named 'views' in namespace 'std'
      for (auto& ls : *layerSurfaces | std::views::reverse) {
				       ~~~~~^
  ../src/Compositor.cpp:1442:38: error: no member named 'views' in namespace 'std'
      for (auto& w : m_vWindows | std::views::reverse) {
				  ~~~~~^
  ../src/Compositor.cpp:1455:38: error: no member named 'views' in namespace 'std'
      for (auto& w : m_vWindows | std::views::reverse) {
				  ~~~~~^
  ../src/Compositor.cpp:2332:26: error: no member named 'any_of' in namespace 'std::ranges'
	  if (std::ranges::any_of(BAD_PORTALS, [&](const std::string& portal) { return std::filesystem::exists("/usr/local/share/xdg-desktop-portal/portals/" + portal + ".portal"); })) {
	      ~~~~~~~~~~~~~^
  • Loading branch information
jbeich committed May 1, 2023
1 parent 5b433fd commit 2b40a3b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pages/Getting Started/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ wlroots installed, you can make sure you have them by installing wlroots
separately (Hyprland doesn't mind)

Also note that Hyprland uses the C++23 standard, so both your compiler
and your C++ library has to support that (`gcc>=12.1.0` or `clang>=15`).
On Clang-based systems libc++ may be used by default, so until libc++
supports C++23 you have to pass `-stdlib=libstdc++` or switch to GCC.
and your C++ library has to support that (`gcc>=12.1.0` or `clang>=16`).
On Clang-based systems with old libc++ by default pass `-stdlib=libstdc++`
or switch to GCC.

### CMake (recommended)

Expand Down

0 comments on commit 2b40a3b

Please sign in to comment.