Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved Compile errors because of "new" file

    General and Desktop
    2
    2
    53
    Loading More Posts
    • 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.
    • T
      Toothpick Hsiao last edited by

      Hi all -

      I accidentally generated a file which is named "new" in the building path. When I compile next time, many compile errors show up. As shown below :

      ...
      ...
      ...
      In file included from C:\Qt\5.12.5\mingw73_32\include/QtCore/qvariant.h:47:0,
                       from C:\Qt\5.12.5\mingw73_32\include\QtGui/qevent.h:50,
                       from C:\Qt\5.12.5\mingw73_32\include\QtGui/QList:1,
                       from debug\../../remove999fracture/postable.h:5,
                       from debug\../../remove999fracture/worker.h:5,
                       from debug\moc_worker.cpp:9:
      C:\Qt\5.12.5\mingw73_32\include/QtCore/qmap.h: In instantiation of 'QMapData<Key, T>::Node* QMapData<Key, T>::createNode(const Key&, const T&, QMapData<Key, T>::Node*, bool) [with Key = QString; T = QVariant; QMapData<Key, T>::Node = QMapNode<QString, QVariant>]':
      C:\Qt\5.12.5\mingw73_32\include/QtCore/qmap.h:811:11:   required from 'QMap<K, V>::iterator QMap<K, V>::insertMulti(const Key&, const T&) [with Key = QString; T = QVariant]'
      C:\Qt\5.12.5\mingw73_32\include/QtCore/qvariant.h:823:66:   required from here
      C:\Qt\5.12.5\mingw73_32\include/QtCore/qmap.h:228:13: error: no matching function for call to 'operator new(sizetype, QString*)'
                   new (&n->key) Key(k);
                   ^~~~~~~~~~~~~~~~~~~~
      <built-in>: note: candidate: void* operator new(unsigned int)
      <built-in>: note:   candidate expects 1 argument, 2 provided
      C:\Qt\5.12.5\mingw73_32\include/QtCore/qmap.h:230:17: error: no matching function for call to 'operator new(sizetype, QVariant*)'
                       new (&n->value) T(v);
                       ^~~~~~~~~~~~~~~~~~~~
      <built-in>: note: candidate: void* operator new(unsigned int)
      <built-in>: note:   candidate expects 1 argument, 2 provided
      ...
      ...
      ...
      

      I guess this result is either that the "new" file overwrites the original file or it is related to the instructions in the makefile.
      But I'm not sure what actually happened.

      There is my file path.
      alt text
      alt text
      alt text

      1 Reply Last reply Reply Quote 0
      • Christian Ehrlicher
        Christian Ehrlicher Lifetime Qt Champion last edited by

        Don't use that name since it's a system header.

        Qt has to stay free or it will die.

        1 Reply Last reply Reply Quote 2
        • First post
          Last post