开发者

Qt “forgets” to link one of my “moc_MyClass.o” objects

开发者 https://www.devze.com 2023-04-07 06:02 出处:网络
The source file is clearly in the project, among the rest of my classes. I have开发者_如何学运维 Q_OBJECT defined for the class, like the rest of my Qt Classes.

The source file is clearly in the project, among the rest of my classes.

I have开发者_如何学运维 Q_OBJECT defined for the class, like the rest of my Qt Classes.

My class compiles with the rest of the classes. Yet, the linker fails on the vtable for the constructor/destructor for my class. Checking the linker command: It seems like the moc_Myclass.cpp is never generated or built. so nothing to link against.

How can that be? why is it left out?


Troubling resolution: When I removed the cpp/h file from the projcet, and then added them back in the moc for my class began being generated correctly so link passed.

That's clearly a Qt "project cancer" bug, but at least now I know how to "cure" it.

0

精彩评论

暂无评论...
验证码 换一张
取 消