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. std::function in Qt 5.4.1
Forum Updated to NodeBB v4.3 + New Features

std::function in Qt 5.4.1

Scheduled Pinned Locked Moved General and Desktop
6 Posts 5 Posters 5.5k Views 4 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.
  • S Offline
    S Offline
    Sanchir Kartiev
    wrote on last edited by Sanchir Kartiev
    #1

    Hello! I can't use std::function in Qt. CONFIG += c++14 in pro, I write #include <functional>
    Qt Creator3.3.2. Qt 5.4.1. Mac OS X. clang-602.0.49.
    When I write std::function - no member named in namespace std.
    How can I fix this?
    Thank You!!!

    1 Reply Last reply
    0
    • T Offline
      T Offline
      t3685
      wrote on last edited by
      #2

      Stupid question, but did you include <functional> in your header file?

      S 1 Reply Last reply
      -1
      • Chris KawaC Offline
        Chris KawaC Offline
        Chris Kawa
        Lifetime Qt Champion
        wrote on last edited by
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • T t3685

          Stupid question, but did you include <functional> in your header file?

          S Offline
          S Offline
          Sanchir Kartiev
          wrote on last edited by
          #4

          @t3685 This question is not stupid, because #include <functional> already exists.

          JKSHJ 1 Reply Last reply
          0
          • S Sanchir Kartiev

            @t3685 This question is not stupid, because #include <functional> already exists.

            JKSHJ Offline
            JKSHJ Offline
            JKSH
            Moderators
            wrote on last edited by
            #5

            @Sanchir-Kartiev said:

            @t3685 This question is not stupid, because #include <functional> already exists.

            In Qt Creator, hover your mouse over #include <functional> and press F2. Inspect the header -- does it look correct?

            Also, what happens if you use CONFIG += c++11 instead?

            Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

            1 Reply Last reply
            0
            • sneubertS Offline
              sneubertS Offline
              sneubert
              wrote on last edited by sneubert
              #6

              Hi Sanchir Kartiev,

              wich compiler are you using? For std::function template your compiler needs to support at least c++11. If your compiler does not support it, the CONFIG += has no effect.

              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