Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. Why std::filesystem is not supported On Mac qt6.2
Forum Updated to NodeBB v4.3 + New Features

Why std::filesystem is not supported On Mac qt6.2

Scheduled Pinned Locked Moved Unsolved Qt 6
5 Posts 3 Posters 1.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    isudfv
    wrote on last edited by
    #1

    QFile has a public function std::filesystem::path filesystemFileName() const but it doesn't work on Mac, because #define QT_FEATURE_cxx17_filesystem is set to -1 in qtcore-config.h. Why is this?

    J.HilkJ 1 Reply Last reply
    0
    • I isudfv

      QFile has a public function std::filesystem::path filesystemFileName() const but it doesn't work on Mac, because #define QT_FEATURE_cxx17_filesystem is set to -1 in qtcore-config.h. Why is this?

      J.HilkJ Offline
      J.HilkJ Offline
      J.Hilk
      Moderators
      wrote on last edited by
      #2

      @isudfv

      for the longest time, clang only supported C++17 language features but not C++17 standard library features, with std::filesystem being a library feature.

      I think, you'll need at least clang 9 or 10.

      So what are you using, what was used for the qt libs to compile ? thats where the config.h comes from (I think)


      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      I 1 Reply Last reply
      0
      • J.HilkJ J.Hilk

        @isudfv

        for the longest time, clang only supported C++17 language features but not C++17 standard library features, with std::filesystem being a library feature.

        I think, you'll need at least clang 9 or 10.

        So what are you using, what was used for the qt libs to compile ? thats where the config.h comes from (I think)

        I Offline
        I Offline
        isudfv
        wrote on last edited by
        #3

        @J-Hilk I'm using Apple clang version 13.1.6 (clang-1316.0.21.2.3) and Qt 6.2.4 macos. std::filesystem is available as long as I set CMAKE_CXX_STANDARD to 17 or later

        J.HilkJ 1 Reply Last reply
        0
        • I isudfv

          @J-Hilk I'm using Apple clang version 13.1.6 (clang-1316.0.21.2.3) and Qt 6.2.4 macos. std::filesystem is available as long as I set CMAKE_CXX_STANDARD to 17 or later

          J.HilkJ Offline
          J.HilkJ Offline
          J.Hilk
          Moderators
          wrote on last edited by
          #4

          @isudfv
          mmh, very odd, Qt6.2 does, afaik, require c++17 support, so, that define should be available 🤔


          Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


          Q: What's that?
          A: It's blue light.
          Q: What does it do?
          A: It turns blue.

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Hi,

            Did you build Qt yourself ?
            If not, how did you install it ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved