moc: standard input:0: Note: No relevant classes found. No output generated.
-
I have project on qt 5.15.2(Community).
This project was build without issues, but after moving one to different directory no moc_* files are creating.
I tested on three different PC, on twos project was build, but on the third I can't.
How this issue can be fixed?
#moc -
When moving the project, make sure to clean up any build artifacts:
- .pro.user files
- .qmake.stash
- Makefile
- etc.
-
Are you sure it is the same code? Same Qt version? Does the class
mocis complaining about haveQ_OBJECTmacro in it? -
Then I don't know what's wrong. Probably some error by moving the code, or misconfigured Qt, it's hard to say :/
-
My first instinct was to scrutinize the
mainofmocitself, but I'm not seeing too many clues:https://github.com/qt/qtbase/blob/d32f7dde257f6d/src/tools/moc/main.cpp#L573
My other thought is the infamous "MAX_PATH" limit of 260 char on windows: https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
Over the years, I have ended up pinning a handful of bizarre and silent failures on the MAX_PATH issue. This should be considered as a candidate diagnosis if the longest path in the project repository reaches 260 char, but should also be considered even if the project paths (from project root) are themselves short, but the absolute path where the project is checked out (or where the build outputs are placed) consists of a long path.