Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Can't find std::shared_mutex
QtWS25 Last Chance

Can't find std::shared_mutex

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 3 Posters 791 Views
  • 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.
  • K Offline
    K Offline
    kitfox
    wrote on 17 Apr 2020, 07:28 last edited by kitfox
    #1

    std::shared_mutex was added with the c++ 17 standard, but it does not seem to be available when I #include <shared_mutex>. I've configured my .pro file to use CONFIG += c++20, but the standard library appears to only be from c++ 14. How would I be able to link against a later standard library?

    https://en.cppreference.com/w/cpp/header/shared_mutex

    J K 2 Replies Last reply 17 Apr 2020, 07:40
    0
    • K kitfox
      17 Apr 2020, 07:28

      std::shared_mutex was added with the c++ 17 standard, but it does not seem to be available when I #include <shared_mutex>. I've configured my .pro file to use CONFIG += c++20, but the standard library appears to only be from c++ 14. How would I be able to link against a later standard library?

      https://en.cppreference.com/w/cpp/header/shared_mutex

      K Offline
      K Offline
      KroMignon
      wrote on 17 Apr 2020, 08:20 last edited by
      #6

      @kitfox I think you have to change CONFIG += c++20 to CONFIG += c++17, AFAIK CONFIG += c++20 do not exist ==> https://doc.qt.io/qt-5/qmake-variable-reference.html#config

      Or maybe use CONFIG += c++latest

      It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

      1 Reply Last reply
      4
      • K kitfox
        17 Apr 2020, 07:28

        std::shared_mutex was added with the c++ 17 standard, but it does not seem to be available when I #include <shared_mutex>. I've configured my .pro file to use CONFIG += c++20, but the standard library appears to only be from c++ 14. How would I be able to link against a later standard library?

        https://en.cppreference.com/w/cpp/header/shared_mutex

        J Offline
        J Offline
        jsulm
        Lifetime Qt Champion
        wrote on 17 Apr 2020, 07:40 last edited by
        #2

        @kitfox You forgot to mention the compiler (including exact version) you're using.

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • K Offline
          K Offline
          kitfox
          wrote on 17 Apr 2020, 07:46 last edited by kitfox
          #3

          How would I check that?

          ef89a670-20d9-4054-ace8-34ea0de3bbc6-image.png

          J 1 Reply Last reply 17 Apr 2020, 08:00
          0
          • K kitfox
            17 Apr 2020, 07:46

            How would I check that?

            ef89a670-20d9-4054-ace8-34ea0de3bbc6-image.png

            J Offline
            J Offline
            jsulm
            Lifetime Qt Champion
            wrote on 17 Apr 2020, 08:00 last edited by
            #4

            @kitfox said in Can't find std::shared_mutex:

            How would I check that?

            In your Kit configuration

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • K Offline
              K Offline
              kitfox
              wrote on 17 Apr 2020, 08:08 last edited by kitfox
              #5

              This is what my kit screens look like. How do I tell what compiler will link against c++17? I tried switching to Qt 5.14.1, but that still doesn't have it.

              bcadf063-3e9f-45e0-ba1c-7f188d4e5c8c-image.png

              2162e2c0-3662-42e5-8e7d-ce2b37925288-image.png

              1 Reply Last reply
              0
              • K kitfox
                17 Apr 2020, 07:28

                std::shared_mutex was added with the c++ 17 standard, but it does not seem to be available when I #include <shared_mutex>. I've configured my .pro file to use CONFIG += c++20, but the standard library appears to only be from c++ 14. How would I be able to link against a later standard library?

                https://en.cppreference.com/w/cpp/header/shared_mutex

                K Offline
                K Offline
                KroMignon
                wrote on 17 Apr 2020, 08:20 last edited by
                #6

                @kitfox I think you have to change CONFIG += c++20 to CONFIG += c++17, AFAIK CONFIG += c++20 do not exist ==> https://doc.qt.io/qt-5/qmake-variable-reference.html#config

                Or maybe use CONFIG += c++latest

                It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

                1 Reply Last reply
                4
                • K Offline
                  K Offline
                  kitfox
                  wrote on 17 Apr 2020, 08:23 last edited by
                  #7

                  That worked. Thanks.

                  1 Reply Last reply
                  0

                  7/7

                  17 Apr 2020, 08:23

                  • Login

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