Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Windows: C++ does not support default-int



  • 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



  • @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.



  • @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.


Log in to reply