std::function in Qt 5.4.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!!! -
Stupid question, but did you include <functional> in your header file?
-
This post is deleted! -
@t3685 This question is not stupid, because #include <functional> already exists.
-
@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? -
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.