Reputation: 7
Working on a fairly large chunk of code written by someone else and I am not super familiar with QT, but I haven't had success with recent debugging.
After working great, I added 3 lines, then commented them all out and when testing got many more variations of these two errors:
undefined reference to 'QObject::connectNotify(char const*)' (.rodata._ZTV15NumberWithUnits[_ZTV15NumberWithUnits]+0x60)
undefined reference to 'QWidget::x11Event(_XEvent*) (.rodata._ZTV15NumberWithUnits[_ZTV15NumberWithUnits]+0x160)
I'm thinking that there might be some library or other build error, or file cleaning I need to do, but I'm stuck.
After searching and trying multiple things, I found several similar answers such as this one and I was trying to implement adding the -lqt statement or fixing qmake.
Recommendations on either how to do this, or other things to try?
Upvotes: 0
Views: 559
Reputation: 2444
Qt relies on a few different types of generated files, and if your build system, whatever it is, doesn't know about those dependencies and doesn't know to re-generate the files when you make changes, then you'll get lots of confusing error messages caused by these generated files being out of date.
In this specific case, the most likely is the "MOC" (meta-object compiler) file being out of date. These files are generated from include files that contain the Q_OBJECT macro, and it's the "moc" utility that creates them.
Other cases include:
Ideally, your build system would have dependencies that says that a generated MOC file is dependent on the matching .h file that contains the Q_OBJECT macro, and your build system would then run "moc" to re-generated the file. If your build system isn't doing that, then you're in for a lot of frustration.
Upvotes: 1