MOC Version Compatibility
-
I've got a project I've been developing in Qt 4.8. I and am trying to version up, specifically to 5.6.1 headers and libs. However I only have access to the MOC binary for versions 5.6.0 or 5.6.3. Building with moc files generated by either produces the following error:
src/#######.moc.cpp:15:2: error: #error "This file was generated using the moc from 5.6.0. It"
src/#######.moc.cpp:16:2: error: #error "cannot be used with the include files from this version of Qt."I was previously using a 4.8.4 MOC binary and building against 4.8.6 headers with no issues, so it surprised me that there was incompatibility between such small version differences.
I'm limited as to what headers I build against, and what binaries we have built. The Qt Installer only seems to offer options of 5.6 or 5.6.3, so is my only option to build from source?
Thanks
-
Moc files are not part of the sources and must be build during the normal build process. So simply remove your old moc files and let qmake recreate them.
-
@Christian-Ehrlicher I'm can't use qmake within our build system so I'm doing the moc stage beforehand with the standalone moc binary.
-
You have to use the correct moc to your headers. When you install Qt you must also install the devel tools for this specific Qt versions. And you should fix your buildsystem to call moc. Those moc files do no belong to the sources.