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 ?
-
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 ?
hi @skylendar,
I think you have to add
CONFIG+=C++1z
to your project.pro
file.regards
Edit: better look here: https://stackoverflow.com/questions/46610996/cant-use-c17-features-using-g-7-2-in-qtcreator
-
hi @skylendar,
I think you have to add
CONFIG+=C++1z
to your project.pro
file.regards
Edit: better look here: https://stackoverflow.com/questions/46610996/cant-use-c17-features-using-g-7-2-in-qtcreator
-
-
-
then please mark this topic as SOLVED. thanks