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/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:287: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 == '.'); });
	     ^~~~~~~~~~~~~~~~~~~
  ../src/managers/AnimationManager.cpp:8:22: error: no member named 'any_of' in namespace 'std::ranges'
	  std::ranges::any_of(g_pCompositor->m_vMonitors, [](const auto& mon) { return mon->m_bEnabled && mon->output; })) {
	  ~~~~~~~~~~~~~^
  ../src/protocols/Screencopy.cpp:134: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:135: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/plugins/PluginSystem.cpp:121:44: error: no member named 'views' in namespace 'std'
      for (auto& p : m_vLoadedPlugins | std::views::reverse)
					~~~~~^
  ../src/plugins/PluginSystem.cpp:129:44: error: no member named 'views' in namespace 'std'
      for (auto& p : m_vLoadedPlugins | std::views::reverse) {
					~~~~~^
  ../src/layout/MasterLayout.cpp:201:51: error: no member named 'views' in namespace 'std'
	  for (auto& nd : m_lMasterNodesData | std::views::reverse) {
					       ~~~~~^
  ../src/layout/MasterLayout.cpp:1055:55: error: no member named 'views' in namespace 'std'
	      for (auto& nd : m_lMasterNodesData | std::views::reverse) {
						   ~~~~~^
  ../src/managers/input/InputManager.cpp:237:57: error: no member named 'views' in namespace 'std'
	  for (auto& w : g_pCompositor->m_vWindows | std::views::reverse) {
						     ~~~~~^
  ../src/config/ConfigManager.cpp:1906: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:1914: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/Compositor.cpp:584:42: error: no member named 'views' in namespace 'std'
	  for (auto& w : m_vWindows | std::views::reverse) {
				      ~~~~~^
  ../src/Compositor.cpp:600:38: error: no member named 'views' in namespace 'std'
      for (auto& w : m_vWindows | std::views::reverse) {
				  ~~~~~^
  ../src/Compositor.cpp:607:38: error: no member named 'views' in namespace 'std'
      for (auto& w : m_vWindows | std::views::reverse) {
				  ~~~~~^
  ../src/Compositor.cpp:652:42: error: no member named 'views' in namespace 'std'
	  for (auto& w : m_vWindows | std::views::reverse) {
				      ~~~~~^
  ../src/Compositor.cpp:669:38: error: no member named 'views' in namespace 'std'
      for (auto& w : m_vWindows | std::views::reverse) {
				  ~~~~~^
  ../src/Compositor.cpp:684:38: error: no member named 'views' in namespace 'std'
      for (auto& w : m_vWindows | std::views::reverse) {
				  ~~~~~^
  ../src/Compositor.cpp:731:42: error: no member named 'views' in namespace 'std'
	  for (auto& w : m_vWindows | std::views::reverse) {
				      ~~~~~^
  ../src/Compositor.cpp:746:38: error: no member named 'views' in namespace 'std'
      for (auto& w : m_vWindows | std::views::reverse) {
				  ~~~~~^
  ../src/Compositor.cpp:753:38: error: no member named 'views' in namespace 'std'
      for (auto& w : m_vWindows | std::views::reverse) {
				  ~~~~~^
  ../src/Compositor.cpp:770:38: error: no member named 'views' in namespace 'std'
      for (auto& w : m_vWindows | std::views::reverse) {
				  ~~~~~^
  ../src/Compositor.cpp:776:38: error: no member named 'views' in namespace 'std'
      for (auto& w : m_vWindows | std::views::reverse) {
				  ~~~~~^
  ../src/Compositor.cpp:1042:43: error: no member named 'views' in namespace 'std'
      for (auto& ls : *layerSurfaces | std::views::reverse) {
				       ~~~~~^
  ../src/Compositor.cpp:1490:38: error: no member named 'views' in namespace 'std'
      for (auto& w : m_vWindows | std::views::reverse) {
				  ~~~~~^
  ../src/Compositor.cpp:1503:38: error: no member named 'views' in namespace 'std'
      for (auto& w : m_vWindows | std::views::reverse) {
				  ~~~~~^
  ../src/Compositor.cpp:2405: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/share/xdg-desktop-portal/portals/" + portal + ".portal"); })) {
	      ~~~~~~~~~~~~~^
  • Loading branch information
jbeich committed Aug 11, 2023
1 parent 43d811b commit 77dfa60
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 @@ -180,9 +180,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 77dfa60

Please sign in to comment.