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. Windows: C++ does not support default-int
Forum Updated to NodeBB v4.3 + New Features

Windows: C++ does not support default-int

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 1.3k Views 2 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.
  • sonichyS Offline
    sonichyS Offline
    sonichy
    wrote on last edited by sonichy
    #1
    void MainWindow::keyPressEvent(QKeyEvent *event)
    {
        qDebug() << event;
        ui->statusBar->showMessage(event->text());
        if (event->key() == Qt::Key_Escape) {
            ui->pushButton_Esc->setChecked(true);
        }
        ....
    }
    

    Linux has no error.

    Windows error:
    moc_mainwindow.cpp

    QT_INIT_METAOBJECT const QMetaObject MainWindow::staticMetaObject = {
    { &QMainWindow::staticMetaObject, qt_meta_stringdata_MainWindow.data,
          qt_meta_data_MainWindow,  qt_static_metacall, nullptr, nullptr}
    };
    

    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

    https://github.com/sonichy

    A K 2 Replies Last reply
    0
    • sonichyS sonichy
      void MainWindow::keyPressEvent(QKeyEvent *event)
      {
          qDebug() << event;
          ui->statusBar->showMessage(event->text());
          if (event->key() == Qt::Key_Escape) {
              ui->pushButton_Esc->setChecked(true);
          }
          ....
      }
      

      Linux has no error.

      Windows error:
      moc_mainwindow.cpp

      QT_INIT_METAOBJECT const QMetaObject MainWindow::staticMetaObject = {
      { &QMainWindow::staticMetaObject, qt_meta_stringdata_MainWindow.data,
            qt_meta_data_MainWindow,  qt_static_metacall, nullptr, nullptr}
      };
      

      error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

      A Offline
      A Offline
      Asperamanca
      wrote on last edited by
      #2

      @sonichy
      In which line is the error raised?
      Typically, some symbol has only been forward-declared, but the corresponding header file has not been included.

      1 Reply Last reply
      1
      • sonichyS sonichy
        void MainWindow::keyPressEvent(QKeyEvent *event)
        {
            qDebug() << event;
            ui->statusBar->showMessage(event->text());
            if (event->key() == Qt::Key_Escape) {
                ui->pushButton_Esc->setChecked(true);
            }
            ....
        }
        

        Linux has no error.

        Windows error:
        moc_mainwindow.cpp

        QT_INIT_METAOBJECT const QMetaObject MainWindow::staticMetaObject = {
        { &QMainWindow::staticMetaObject, qt_meta_stringdata_MainWindow.data,
              qt_meta_data_MainWindow,  qt_static_metacall, nullptr, nullptr}
        };
        

        error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

        K Offline
        K Offline
        koahnig
        wrote on last edited by
        #3

        @sonichy

        You should indicate for which line the error is output.

        I would assume that it is

            qDebug() << event;
        

        You are simply trying to output an address there. That is probably open to debate if you want to treat as error or not.
        If you are really interested in the address only, than cast it as an integer.

        Vote the answer(s) that helped you to solve your issue(s)

        1 Reply Last reply
        2

        • Login

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