Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

no member named 'unique_ptr' in namespace 'std'



  • I am trying to use std::unique_ptr in the main.cpp
    but I get this error error: no member named 'unique_ptr' in namespace 'std'
    In the .pro file I have CONFIG += c++14
    Library : Qt5.11
    Compiler: gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.10)

    What am I missing?
    TIA



  • SOLVED

    Add his include which is needed for std::unique_ptr

    #include <memory>  
    

    Or, in case is possible to replace

    std::unique_ptr<T>
    

    it with the same Qt-style operator

    QScopedPointer<T>
    

Log in to reply