I am working on a Qt based project that uses cmake. All of my generated moc files are named *.moc
, but I have some files that their generated moc files have names moc_*.cpp
, not *.moc
. Why this happens and how I can fix these files.
EDIT:
I want to say that these classes are inheriting from QObject and has the Q_OBJECT and Q_DECLARE_PUBLIC macros, and they don't compile with me unless there is a .moc for them.
I must include the .moc files in my .cpp files.
- The thing that makes me go crazy that I have an identical class (identical implementation to my class) that generates a .moc but my class generate moc_*.cpp.
*.moc
, do they consist of both a*.h
and a*.cpp
? The*.moc
files (not themoc_*.cpp
files), are they put in the build or the source directory? – leemes