So I have started learning QT on my own. Documentation for QT seems just fabulous. So today I am in tutorial number 4, and here as exercise I created a basic signal and slot. But I got this error .. undefined reference to `vtable for MyWidget'
I had put the class definion in my .cpp file and was struggling to get it compiled. But it would never compile and throw above compiler error along with some other random erros. When I googled, I got below link
http://www.qtforum.org/article/302/Fixing-undefined-reference-to-vtable-.html
Sometimes the linking stage of compiling might fail with the rather confusing error:
undefined reference to `vtable for MyWidget`
So theme is don't put class definitions in .cpp files when they have the Q_OBJECT macro.
I had put the class definion in my .cpp file and was struggling to get it compiled. But it would never compile and throw above compiler error along with some other random erros. When I googled, I got below link
http://www.qtforum.org/article/302/Fixing-undefined-reference-to-vtable-.html
Sometimes the linking stage of compiling might fail with the rather confusing error:
undefined reference to `vtable for MyWidget`
So theme is don't put class definitions in .cpp files when they have the Q_OBJECT macro.
Need Mail bonding?
Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users.

No comments:
Post a Comment