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. no member named 'unique_ptr' in namespace 'std'
QtWS25 Last Chance

no member named 'unique_ptr' in namespace 'std'

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 4.5k Views
  • 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.
  • MarukoM Offline
    MarukoM Offline
    Maruko
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • MarukoM Offline
      MarukoM Offline
      Maruko
      wrote on last edited by
      #2

      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>
      
      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved