SOS:undefined reference to `vtable for<class name>
-
@J.Hilk
I guess that's is the point, MOC tools can't prduce moc*.cpp file
But I don't know why .
the almost answer in google is that the encode of file is wrong,qt need utf-8,but i change the encode of .h file by vs and notepad++, it still don't work...@qazaq408 said in SOS:undefined reference to `vtable for<class name>:
I guess that's is the point, MOC tools can't prduce moc*.cpp file
Then please do clean all build artefacts, and then compile your project. Paste the compile log here for analysis.
PS: Also make sure that there are no Makefile, *.moc, *.o and other generated files in your source directory! This will lead to the strangest effects possible.
-
@qazaq408 said in SOS:undefined reference to `vtable for<class name>:
I guess that's is the point, MOC tools can't prduce moc*.cpp file
Then please do clean all build artefacts, and then compile your project. Paste the compile log here for analysis.
PS: Also make sure that there are no Makefile, *.moc, *.o and other generated files in your source directory! This will lead to the strangest effects possible.
@aha_1980
I had done this....
even I cpoy these three file (Moctst.h,MocTest.cpp,Main.cpp) to another dir,like E:/tkand use cmd.exe
/////
e:
cd ./tk
moc MocTest.h -o Moc_MocTest.cppthe system tell me .E:\tk\MocTest.h:1: Note: No relevant classes found. No output generated....
-
@aha_1980
I had done this....
even I cpoy these three file (Moctst.h,MocTest.cpp,Main.cpp) to another dir,like E:/tkand use cmd.exe
/////
e:
cd ./tk
moc MocTest.h -o Moc_MocTest.cppthe system tell me .E:\tk\MocTest.h:1: Note: No relevant classes found. No output generated....
-
@qazaq408 Don't copy anything, just create a new project and add there a new dialog and see whether it works.
-
@jsulm
if I create a new object that has a new dialog,(I don't revise anything and the class with Q_OBJECT marco),and make,
system tell me
and if i delete Q_OBJECT marco,it works ,but still has a question
-
I take it...my company systm file are encrypted so that add some question when Qt produce .o file. I run win7 in the vritulBox and it's work!!!!!
Thank brother Chun,
Thank god
Thank everyone who help me or not,thank you cost so much time to answer my question.thank you!!