Set up mocwrapper

For the license checks to work, replace the Meta-Object Compiler (moc) with mocwrapper. This means that the Qt build system calls mocwrapper to handle license checks instead of moc. If the license already exists in the local license cache, the process is quick. If it doesn't, Qt License Server obtains the license and caches it on the local disk for quicker access.

Note: These steps are necessary only if you install Qt License Service manually or if the mocwrapper integration is not included in your Qt version (available in Qt 6.8.1 or later).

Obtain mocwrapper

To obtain mocwrapper, install Qt License Service or Qt. Then find mocwrapper from the following locations depending on your installation method:

InstallationLocation
Qt License ServiceLicenseManagementTools/QtLicenseServer/<version>/QtLicenseService/<operating system>/mocwrapper
QtQt 6: <Qt version>/gcc_64/libexec/mocwrapper

Qt 5: <Qt version>/gcc_64/bin/mocwrapper

Replace moc with mocwrapper

  1. Make sure you're in the correct directory:
    • Qt6:
      cd <your Qt Framework installation path>/libexec
    • Qt5:
      cd <your Qt Framework installation path>/bin
  2. Rename moc to qtmoc:
    mv moc qtmoc
  3. Copy mocwrapper to the directory you're in:
    cp LicenseManagementTools/QtLicenseServer/<version>/QtLicenseService/<platform>/mocwrapper moc
  4. Build any Qt application with any IDE or from the command line to ensure that you set the installation path correctly.
  1. Make sure you're in the correct directory:
    • Qt6:
      cd <your Qt Framework installation path>/libexec
    • Qt5:
      cd <your Qt Framework installation path>/bin
  2. Rename moc to qtmoc:
    mv moc qtmoc
  3. Copy mocwrapper to the directory you're in:
    cp LicenseManagementTools/QtLicenseServer/<version>/QtLicenseService/<platform>/mocwrapper moc
  4. Build any Qt application with any IDE or from the command line to ensure that you set the installation path correctly.
  1. Make sure you're in the correct directory:
    cd <your Qt Framework installation path>\bin
  2. Rename moc to qtmoc:
    move moc.exe qtmoc.exe
  3. Copy mocwrapper to the directory you're in:
    cp LicenseManagementTools\QtLicenseServer\<version>\QtLicenseService\<platform>\mocwrapper.exe moc.exe
  4. Build any Qt application with any IDE or from the command line to ensure that you set the installation path correctly.

Verify the mocwrapper version

To verify which version of mocwrapper you have:

./mocwrapper --mocwrapper-version
./mocwrapper --mocwrapper-version
.\mocwrapper.exe --mocwrapper-version

Disable legacy license check for Qt 5

To disable legacy support for the Qt 5 qmake licensing system, replace the licheck binary with the provided one:

In <your Qt Framework installation path>/bin:

  1. Back up the original licheck with any name:
    cp licheck licheck.bak
  2. Copy licheck replacement into its place:
    cp /LicenseManagementTools/QtLicenseServer/<version>/QtLicenseService/<platform>/licheck licheck

In <your Qt Framework installation path>/bin:

  1. Back up the original licheck with any name:
    cp licheck licheck.bak
  2. Copy licheck replacement into its place:
    cp /LicenseManagementTools/QtLicenseServer/<version>/QtLicenseService/<platform>/licheck licheck

In <your Qt Framework installation path>/bin:

  1. Back up the original licheck with any name:
    move licheck.exe licheck_bak.exe
  2. Copy licheck replacement into its place:
    copy LicenseManagementTools\QtLicenseServer\<version>\QtLicenseService\<platform>\licheck.exe .

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.