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. Compile errors because of "new" file
Forum Updated to NodeBB v4.3 + New Features

Compile errors because of "new" file

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 162 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.
  • T Offline
    T Offline
    Toothpick Hsiao
    wrote on 10 Jun 2020, 04:03 last edited by
    #1

    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
    0
    • C Offline
      C Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 10 Jun 2020, 04:21 last edited by
      #2

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

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      2

      1/2

      10 Jun 2020, 04:03

      • Login

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