Important: Please read the Qt Code of Conduct -

Basic Qt3D Example fails to run correctly when deployed.

  • Hi.
    I have used windeployqt.exe before to deploy both C++ and QML applications on Windows 10.

    However, as I tried to deploy the Qt3D: QML wireframe Example and run it, only the window shows; the trefoil knot does not (running the example in Qt Creator works).

    I used the following script for the deployment:

    @echo off
    if not defined in_subprocess (cmd /k set in_subprocess=y ^& %0 %*) & exit )
    call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
    set BUILD_DIR="D:\Qt\Examples\Qt-5.11.0\qt3d\build-wireframe-Desktop_Qt_5_11_0_MSVC2017_64bit3-Debug\debug"
    set DEPLOY_EXE=D:\Qt\5.11.0\msvc2017_64\bin\windeployqt.exe
    set BUILD_EXE=wireframe.exe
    set OUT_EXE="wireframe.exe"
    set OUTDIR=%BUILD_DIR%\..\..\_Deployment\Wireframe_Debug
    set BUILD_DRIVE=%BUILD_DIR:~1,1%:
    set CD_BUILD=cd %BUILD_DIR%
    set QMLDIR="D:\Qt\5.11.0\msvc2017_64\qml"
    set DEPLOY=%DEPLOY_EXE% --dir %OUTDIR% --qmldir %QMLDIR% %BUILD_EXE% --compiler-runtime --force --verbose 1
    %SystemRoot%\explorer.exe %OUTDIR%
    set /p=Hit ENTER to continue...

    Since QT_OPENGL needs to be set to desktop instead of angle, I also made sure that environment variable is defined as such in my Windows system environment settings (I used to only change it in the Qt Creator Run-time environment settings) , but to no avail.

    Also the Dependencies tool did not report any missing dependencies for the binary.

    Any ideas what I am missing here?

  • Lifetime Qt Champion


    I don't remember for which version it was fixed but there were plugins missing when deploying Qt3D based application at some point.

    Check that.

    You can verify what is currently loaded running your application with the QT_DEBUG_PLUGIN environment variable set to 1.

  • @SGaist said in Basic Qt3D Example fails to run correctly when deployed.:


    Thank you!
    I should have looked to the Debugging Techniques page first...

    Setting the above environment variable resulted in the following output when deployed:

    qrc:/main.qml:53:1: module "Qt3D.Render" is not installed
    qrc:/main.qml:55:1: module "Qt3D.Extras" is not installed
    qrc:/main.qml:54:1: module "Qt3D.Input" is not installed
    qrc:/main.qml:52:1: module "Qt3D.Core" is not installed

    So all that needed to be done was to copy the Qt\5.11.0\msvc2017_64\qml\Qt3D folder to the deployment folder.


Log in to reply