Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. MOC Version Compatibility

MOC Version Compatibility

Scheduled Pinned Locked Moved Unsolved General and Desktop
moccompatibilitybinaryheadercompiling
4 Posts 2 Posters 2.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    JoeWB
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      J 1 Reply Last reply
      3
      • Christian EhrlicherC Christian Ehrlicher

        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.

        J Offline
        J Offline
        JoeWB
        wrote on last edited by
        #3

        @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.

        1 Reply Last reply
        0
        • Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          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.

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          1 Reply Last reply
          4

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved