L
L
Loligan2015-05-27 07:38:11
Qt
Loligan, 2015-05-27 07:38:11

Can't figure out how to fix errors in a QT Widgets project?

error: undefined reference to `Profile::Profile(QWidget*)'

void Social::on_action_triggered()
{
Profile *pf = new Profile;
pf->show();
}

//____________________
error: undefined reference to `Profile::on_buttonBox_accepted()'
;
complain in all cases

void Profile::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
Q_ASSERT(staticMetaObject.cast(_o));
Profile *_t = static_cast(_o);
ccase 0: _t->on_buttonBox_accepted(); break;
case 1: _t->on_buttonBox_rejected(); break;
case 2: _t->get_log_a_pas((*reinterpret_cast< QString(*)>(_a[1])),(*..........
default: ;
}
}
}

Error:
C:\\iwmake\\build_mingw_opensource\\src\\winmain\qtmain_win.cpp:131: error: undefined reference to `qMain(int, char**)'

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Armenian Radio, 2015-05-27
@gbg

Either you forgot Q_OBJECT in the profile declaration, or you need to restart qmake

S
Stanislav Makarov, 2015-05-27
@Nipheris

The first fragment - did you forget to include the header with the Profile?
The second snippet is to rebuild the moc file that has these errors. Apparently it's no longer relevant.

D
DancingOnWater, 2015-05-27
@DancingOnWater

You didn't define on_buttonBox_accepted methods, which is what the linker told you to do.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question