forced to use QT5_WRAP_CPP macro instead of automoc property in cmake
问题 According to the cmake documentation I should be able to only use a property rather than having to wrap my header files, which contain a Q_OBJECT macro like in the following cmake snippet. If I use the wrapping macro the code compiles and runs but if I use only the enabled property, I get a compiler error ../gui/libgui.so: undefined reference to `vtable for ImageWidget' why is that? cmake_minimum_required (VERSION 3.5.1 FATAL_ERROR) project (app) #QT5_WRAP_CPP(MOC_files # ../gui/include/gui