刚认识QT,将实现的类写在main.cpp里,编译会报错 symbol(s) not found for architecture x86_64 解决方法:在main.cpp最末尾加上 #include <main.moc>