Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
make_unique<>() not found
Hi there, I suppose this topic is not new, but in my case it is quit embarrassing.
In a basic cpp test program compiled with gcc 7.3 x86_64 -std=gnu++17, I declare:
auto p = make_unique<mytype>();
cout << __cplusplus << endl;
so far, so good. the prog compiles, runs and returns '201402' which is correct.
However, when I try to compile a prog linked with Qt5.11 libraries, I got:
error : use of undeclared identifier 'make_unique', and __cplusplus is set to '201103'.
What's wrong ?
I think you have to add
CONFIG+=C++1zto your project
Edit: better look here: https://stackoverflow.com/questions/46610996/cant-use-c17-features-using-g-7-2-in-qtcreator
Thx for the answer, but I use CMake. So...
Ah, I found finally:
target_compile_features(myapp PUBLIC cxx_std_17)
then please mark this topic as SOLVED. thanks