error: ‘QT_INIT_METAOBJECT’ does not name a type; did you mean ‘Q_INIT_RESOURCE’?
-
Randomly started getting this error for a reason I do not know, I was editing some functions and all of a sudden this error is popping up. Would anyone know what this means and how to fix it?
error: ‘QT_INIT_METAOBJECT’ does not name a type; did you mean ‘Q_INIT_RESOURCE’?
moc_mainwindow.cpp:93:1: error: ‘QT_INIT_METAOBJECT’ does not name a type; did you mean ‘Q_INIT_RESOURCE’?
QT_INIT_METAOBJECT const QMetaObject MainWindow::staticMetaObject = { {
^~~~~~~~~~~~~~~~~~
Q_INIT_RESOURCE -
I would start with a clean source (make sure there are no generated files) and build dir
-
Hi,
Which version of Qt ?
What code does trigger that ? -
QT 5.9.5
This is the function in moc_mainwindow.cpp that is causing the issue
QT_INIT_METAOBJECT const QMetaObject MainWindow::staticMetaObject = { { QMetaObject::SuperData::link<QMainWindow::staticMetaObject>(), qt_meta_stringdata_MainWindow.data, qt_meta_data_MainWindow, qt_static_metacall, nullptr, nullptr } };
-
Can you show your MainWindow header ?
-
Nothing obvious comes to mind. Do you have the same issue if you comment all the non Qt related code (includes as well) ?
-
The content of the moc file can change but that should not concern you directly as they are automatically generated.
Any chance that this moc file was not regenerated ?
-
I would start with a clean source (make sure there are no generated files) and build dir