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. [SOLVED] Qt 5.0.1 on Mac OS X can't use unique_ptr

[SOLVED] Qt 5.0.1 on Mac OS X can't use unique_ptr

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 3.6k Views 1 Watching
  • 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.
  • J Offline
    J Offline
    janusz
    wrote on last edited by
    #1

    I'm trying to use unique_ptr (smart pointer from c++11) in my simple Qt 5 application, I have MainWindow and NotificationWindow.

    I have this in my .pro file
    @
    QMAKE_CXXFLAGS += -std=c++11
    CONFIG+=c++11
    @

    First, my spec, auto generated in Qt Creator was just macx-clang and build was giving me the following errors:
    @
    /Users/administrator/Qt5.0.1/5.0.1/clang_64/include/QtCore/qlist.h:52: error: 'initializer_list' file not found
    #include <initializer_list>
    @

    So I added to qmake arguments list this:
    @-spec macx-clang-libc++@

    But I'm getting the following error:
    @
    /usr/lib/c++/v1/memory:2483: error: invalid application of 'sizeof' to an incomplete type 'Ui::NotificationDialog'
    static_assert(sizeof(_Tp) > 0, "default_delete can not delete incomplete type");
    @

    Any clues how to use unique_ptr on Mac OS X with Qt 5.0.1 and Qt Creator 2.6 ?

    1 Reply Last reply
    0
    • J Offline
      J Offline
      janusz
      wrote on last edited by
      #2

      I solved my problem by creating a missing destructor for NotificationDialog class in the implementation NotificationDialog.cpp file

      @NotificationDialog::~NotificationDialog(){}@

      But still

      @-spec macx-clang-libc++@

      is needed to use smart pointers.

      1 Reply Last reply
      0

      • Login

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