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. "enable_if_t" has no member "type"

"enable_if_t" has no member "type"

Scheduled Pinned Locked Moved Solved Qt 6
4 Posts 3 Posters 1.3k 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.
  • T Offline
    T Offline
    Timothy_Xin
    wrote on 10 May 2021, 08:52 last edited by
    #1

    Hello there,

    I'm completely new to Qt. Just downloaded the Qt6 and try to play with the examples.
    The OS is Ubuntu 20.04 LTS and the Qt version is 6.1.0.
    Every time I tried to compile the project I got the following error message:
    /usr/include/c++/9/type_traits:2385: error: class "std::enable_if<false, void>" has no member "type"
    using enable_if_t = typename enable_if<_Cond, _Tp>::type;
    detected during:
    instantiation of type "std::enable_if_t<false, void>" at line 271 of "~/Qt/6.1.0/gcc_64/include/QtCore/qlist.h"
    instantiation of class "QList<T> [with T=uint={unsigned int}]" at line 939 of "~/Qt/6.1.0/gcc_64/include/QtCore/qlist.h"

    Can anyone please help me out here?

    Many thx.

    C 1 Reply Last reply 10 May 2021, 19:17
    0
    • T Timothy_Xin
      10 May 2021, 08:52

      Hello there,

      I'm completely new to Qt. Just downloaded the Qt6 and try to play with the examples.
      The OS is Ubuntu 20.04 LTS and the Qt version is 6.1.0.
      Every time I tried to compile the project I got the following error message:
      /usr/include/c++/9/type_traits:2385: error: class "std::enable_if<false, void>" has no member "type"
      using enable_if_t = typename enable_if<_Cond, _Tp>::type;
      detected during:
      instantiation of type "std::enable_if_t<false, void>" at line 271 of "~/Qt/6.1.0/gcc_64/include/QtCore/qlist.h"
      instantiation of class "QList<T> [with T=uint={unsigned int}]" at line 939 of "~/Qt/6.1.0/gcc_64/include/QtCore/qlist.h"

      Can anyone please help me out here?

      Many thx.

      C Offline
      C Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on 10 May 2021, 19:17 last edited by Chris Kawa 5 Oct 2021, 19:18
      #2

      Hi, welcome to the forum.

      The ::type helper was added in C++14 so it seems you're running your compiler in C++11 mode.
      Qt 6 requires C++17, so you need to make sure you're using that version of the standard: CONFIG += c++17 in the .pro file if you're using qmake.

      V 1 Reply Last reply 11 May 2021, 13:45
      5
      • C Chris Kawa
        10 May 2021, 19:17

        Hi, welcome to the forum.

        The ::type helper was added in C++14 so it seems you're running your compiler in C++11 mode.
        Qt 6 requires C++17, so you need to make sure you're using that version of the standard: CONFIG += c++17 in the .pro file if you're using qmake.

        V Offline
        V Offline
        VRonin
        wrote on 11 May 2021, 13:45 last edited by
        #3

        @Chris-Kawa said in "enable_if_t" has no member "type":

        CONFIG += c++17 in the .pro file if you're using qmake.

        And if you are using CMake

        set_target_properties(MyApplication PROPERTIES
            CXX_STANDARD 17
            CXX_STANDARD_REQUIRED ON
        )
        

        "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
        ~Napoleon Bonaparte

        On a crusade to banish setIndexWidget() from the holy land of Qt

        1 Reply Last reply
        4
        • T Offline
          T Offline
          Timothy_Xin
          wrote on 12 May 2021, 00:45 last edited by
          #4

          Thank you guys. Problem solved. Added the flag as Chris suggested. It turns out I was also using icpc as my default compiler and that was also giving my trouble.

          1 Reply Last reply
          0

          3/4

          11 May 2021, 13:45

          • Login

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