Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

An empty project does not run with MinGW after a clean reinstall of Qt



  • An empty project does not run from Creator with MinGW (v7.3.0) after a clean reinstall of Qt. This only happens with MinGW. With MSVC 2017 it works fine.

    Qt 5.14.1
    QtCreator 4.11.1
    Windows 10

    Безымянный.png


  • Moderators

    @Alexey-Moiseev said in An empty project does not run with MinGW after a clean reinstall of Qt:

    I see only QT_PLUGIN_PATH set in C:\Dev\Qt\Tools\QtCreator\bin\plugins by default.

    That will cause all Qt-based applications on your PC to load Qt Creator DLLs.

    QT_PLUGIN_PATH should not be set globally. Remove it.


  • Moderators

    @Alexey-Moiseev said in An empty project does not run with MinGW after a clean reinstall of Qt:

    This only happens with MinGW. With MSVC 2017 it works fine.

    I suspect that your system PATH is polluted with a folder that contains Qt DLLs that were built using MSVC. You'll need to find and remove that folder from your PATH.

    To identify that folder,

    1. Go to your project's Run Settings > Run Environment (see https://doc.qt.io/qtcreator/creator-run-settings.html#selecting-the-run-environment )
    2. Add a new environment variable (Variable: QT_DEBUG_PLUGINS, Value: 1)
    3. Try to run the application
    4. Look at the Application Output pane and see which folder it's trying to load qwindows.dll from.


  • @JKSH said in An empty project does not run with MinGW after a clean reinstall of Qt:

    folder that contains Qt DLLs that were built using MSVC

    All links lead to Qt directory.
    For some reason, the second time the window is searched in a "platform" folder located in the output directory.

    17:11:51: Starting C:\_Projects\build-CTE_desktop-Desktop_Qt_5_14_1_MinGW_32_bit-Debug\CTE_desktop.exe ...
    QFactoryLoader::QFactoryLoader() checking directory path "C:/Dev/Qt/Tools/QtCreator/bin/plugins/platforms" ...
    QFactoryLoader::QFactoryLoader() looking at "C:/Dev/Qt/Tools/QtCreator/bin/plugins/platforms/qdirect2d.dll"
    Found metadata in lib C:/Dev/Qt/Tools/QtCreator/bin/plugins/platforms/qdirect2d.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "direct2d"
            ]
        },
        "archreq": 0,
        "className": "QWindowsDirect2DIntegrationPlugin",
        "debug": false,
        "version": 331264
    }
    
    
    Got keys from plugin meta data ("direct2d")
    QFactoryLoader::QFactoryLoader() looking at "C:/Dev/Qt/Tools/QtCreator/bin/plugins/platforms/qminimal.dll"
    Found metadata in lib C:/Dev/Qt/Tools/QtCreator/bin/plugins/platforms/qminimal.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "minimal"
            ]
        },
        "archreq": 0,
        "className": "QMinimalIntegrationPlugin",
        "debug": false,
        "version": 331264
    }
    
    
    Got keys from plugin meta data ("minimal")
    QFactoryLoader::QFactoryLoader() looking at "C:/Dev/Qt/Tools/QtCreator/bin/plugins/platforms/qoffscreen.dll"
    Found metadata in lib C:/Dev/Qt/Tools/QtCreator/bin/plugins/platforms/qoffscreen.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "offscreen"
            ]
        },
        "archreq": 0,
        "className": "QOffscreenIntegrationPlugin",
        "debug": false,
        "version": 331264
    }
    
    
    Got keys from plugin meta data ("offscreen")
    QFactoryLoader::QFactoryLoader() looking at "C:/Dev/Qt/Tools/QtCreator/bin/plugins/platforms/qwindows.dll"
    Found metadata in lib C:/Dev/Qt/Tools/QtCreator/bin/plugins/platforms/qwindows.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "windows"
            ]
        },
        "archreq": 0,
        "className": "QWindowsIntegrationPlugin",
        "debug": false,
        "version": 331264
    }
    
    
    Got keys from plugin meta data ("windows")
    QFactoryLoader::QFactoryLoader() checking directory path "C:/Dev/Qt/5.14.1/mingw73_32/plugins/platforms" ...
    QFactoryLoader::QFactoryLoader() looking at "C:/Dev/Qt/5.14.1/mingw73_32/plugins/platforms/qdirect2d.dll"
    Found metadata in lib C:/Dev/Qt/5.14.1/mingw73_32/plugins/platforms/qdirect2d.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "direct2d"
            ]
        },
        "archreq": 0,
        "className": "QWindowsDirect2DIntegrationPlugin",
        "debug": false,
        "version": 331264
    }
    
    
    Got keys from plugin meta data ("direct2d")
    QFactoryLoader::QFactoryLoader() looking at "C:/Dev/Qt/5.14.1/mingw73_32/plugins/platforms/qminimal.dll"
    Found metadata in lib C:/Dev/Qt/5.14.1/mingw73_32/plugins/platforms/qminimal.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "minimal"
            ]
        },
        "archreq": 0,
        "className": "QMinimalIntegrationPlugin",
        "debug": false,
        "version": 331264
    }
    
    
    Got keys from plugin meta data ("minimal")
    QFactoryLoader::QFactoryLoader() looking at "C:/Dev/Qt/5.14.1/mingw73_32/plugins/platforms/qoffscreen.dll"
    Found metadata in lib C:/Dev/Qt/5.14.1/mingw73_32/plugins/platforms/qoffscreen.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "offscreen"
            ]
        },
        "archreq": 0,
        "className": "QOffscreenIntegrationPlugin",
        "debug": false,
        "version": 331264
    }
    
    
    Got keys from plugin meta data ("offscreen")
    QFactoryLoader::QFactoryLoader() looking at "C:/Dev/Qt/5.14.1/mingw73_32/plugins/platforms/qwindows.dll"
    Found metadata in lib C:/Dev/Qt/5.14.1/mingw73_32/plugins/platforms/qwindows.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "windows"
            ]
        },
        "archreq": 0,
        "className": "QWindowsIntegrationPlugin",
        "debug": false,
        "version": 331264
    }
    
    
    Got keys from plugin meta data ("windows")
    QFactoryLoader::QFactoryLoader() checking directory path "C:/_Projects/build-CTE_desktop-Desktop_Qt_5_14_1_MinGW_32_bit-Debug/platforms" ...
    Cannot load library C:\Dev\Qt\Tools\QtCreator\bin\plugins\platforms\qwindows.dll: The specified procedure was not found.
    QLibraryPrivate::loadPlugin failed on "C:/Dev/Qt/Tools/QtCreator/bin/plugins/platforms/qwindows.dll" : "Cannot load library C:\\Dev\\Qt\\Tools\\QtCreator\\bin\\plugins\\platforms\\qwindows.dll: The specified procedure was not found."
    qt.qpa.plugin: Could not load the Qt platform plugin "windows" in "" even though it was found.
    This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
    
    Available platform plugins are: direct2d, minimal, offscreen, windows.
    
    17:11:55: The program has unexpectedly finished.
    17:11:55: The process was ended forcefully.
    17:11:55: C:\_Projects\build-CTE_desktop-Desktop_Qt_5_14_1_MinGW_32_bit-Debug\CTE_desktop.exe crashed.
    

  • Moderators

    @Alexey-Moiseev said in An empty project does not run with MinGW after a clean reinstall of Qt:

    QFactoryLoader::QFactoryLoader() checking directory path "C:/Dev/Qt/Tools/QtCreator/bin/plugins/platforms" ...
    

    This is an error. The DLLs in <Qt>/Tools/QtCreator/ are for running the Qt Creator IDE; they are not for running your projects.

    The DLLs for Qt Creator 4.11.1 are built with MSVC 2017 32-bit. They are incompatible with applications that are built with MinGW.

    You need to stop your project applications from loading the Qt Creator DLLs. Do you have C:\Dev\Qt\Tools\QtCreator in your PATH? If so, remove it.



  • @JKSH said in An empty project does not run with MinGW after a clean reinstall of Qt:

    Do you have C:\Dev\Qt\Tools\QtCreator in your PATH?

    No, I don't have. I see only QT_PLUGIN_PATH set in C:\Dev\Qt\Tools\QtCreator\bin\plugins by default.


  • Moderators

    @Alexey-Moiseev said in An empty project does not run with MinGW after a clean reinstall of Qt:

    I see only QT_PLUGIN_PATH set in C:\Dev\Qt\Tools\QtCreator\bin\plugins by default.

    That will cause all Qt-based applications on your PC to load Qt Creator DLLs.

    QT_PLUGIN_PATH should not be set globally. Remove it.



  • same issue here:

    QFactoryLoader::QFactoryLoader() checking directory path "C:/Qt5.15/5.15.1/mingw81_64/plugins/platforms" ...
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt5.15/5.15.1/mingw81_64/plugins/platforms/qdirect2d.dll"
    Found metadata in lib C:/Qt5.15/5.15.1/mingw81_64/plugins/platforms/qdirect2d.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "direct2d"
            ]
        },
        "archreq": 0,
        "className": "QWindowsDirect2DIntegrationPlugin",
        "debug": false,
        "version": 331520
    }
    
    
    Got keys from plugin meta data ("direct2d")
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt5.15/5.15.1/mingw81_64/plugins/platforms/qminimal.dll"
    Found metadata in lib C:/Qt5.15/5.15.1/mingw81_64/plugins/platforms/qminimal.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "minimal"
            ]
        },
        "archreq": 0,
        "className": "QMinimalIntegrationPlugin",
        "debug": false,
        "version": 331520
    }
    
    
    Got keys from plugin meta data ("minimal")
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt5.15/5.15.1/mingw81_64/plugins/platforms/qoffscreen.dll"
    Found metadata in lib C:/Qt5.15/5.15.1/mingw81_64/plugins/platforms/qoffscreen.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "offscreen"
            ]
        },
        "archreq": 0,
        "className": "QOffscreenIntegrationPlugin",
        "debug": false,
        "version": 331520
    }
    
    
    Got keys from plugin meta data ("offscreen")
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt5.15/5.15.1/mingw81_64/plugins/platforms/qwebgl.dll"
    Found metadata in lib C:/Qt5.15/5.15.1/mingw81_64/plugins/platforms/qwebgl.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "webgl"
            ]
        },
        "archreq": 0,
        "className": "QWebGLIntegrationPlugin",
        "debug": false,
        "version": 331520
    }
    
    
    Got keys from plugin meta data ("webgl")
    QFactoryLoader::QFactoryLoader() looking at "C:/Qt5.15/5.15.1/mingw81_64/plugins/platforms/qwindows.dll"
    Found metadata in lib C:/Qt5.15/5.15.1/mingw81_64/plugins/platforms/qwindows.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "windows"
            ]
        },
        "archreq": 0,
        "className": "QWindowsIntegrationPlugin",
        "debug": false,
        "version": 331520
    }
    
    
    Got keys from plugin meta data ("windows")
    QFactoryLoader::QFactoryLoader() checking directory path "C:/Work/qdomyos-zwift/src/debug/platforms" ...
    Cannot load library C:\Qt5.15\5.15.1\mingw81_64\plugins\platforms\qwindows.dll: Impossibile trovare la procedura specificata.
    QLibraryPrivate::loadPlugin failed on "C:/Qt5.15/5.15.1/mingw81_64/plugins/platforms/qwindows.dll" : "Cannot load library C:\\Qt5.15\\5.15.1\\mingw81_64\\plugins\\platforms\\qwindows.dll: Impossibile trovare la procedura specificata."
    qt.qpa.plugin: Could not load the Qt platform plugin "windows" in "" even though it was found.
    This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
    
    Available platform plugins are: direct2d, minimal, offscreen, webgl, windows.
    
    Press <RETURN> to close this window...
    
    

    i didn't see any issue. I haven't any QT_PLUGIN_PATH set.


  • Moderators

    @Roberto-Viola said in An empty project does not run with MinGW after a clean reinstall of Qt:

    QFactoryLoader::QFactoryLoader() checking directory path "C:/Work/qdomyos-zwift/src/debug/platforms" ...
    Cannot load library C:\Qt5.15\5.15.1\mingw81_64\plugins\platforms\qwindows.dll: Impossibile trovare la procedura specificata.
    

    C:\Work\qdomyos-zwift\src\debug\ is not the default style of folder hierarchy used by Qt Creator.

    1. Are you building and running your program from Qt Creator? If so, did you use custom build settings?
    2. You said you don't have QT_PLUGIN_PATH set. Do you have any other Qt-related environment variables set?
    3. What happens if you delete your build folder and re-build your program?
    4. What happens if you create a Release build instead of a Debug build?
    5. Do you have any other versions of Qt installed? If so, what happens if you use that instead of Qt 5.15.1 for MinGW x64?


  • thanks @JKSH for answering me.

    i was not using shadow building, it's why you saw a strange path. Same error with shadow building active.

    1. yes, inside qt creator. No i'm not using custom buid settings
    2. No, just the QT_DEBUG_PLUGIN
    3. tried, same thing
    4. same thing
    5. yes a have full qt package (MSVC, MING32 and 64, ANDROID...). MINGW32bit works fine, for example.

  • Moderators

    @Roberto-Viola said in An empty project does not run with MinGW after a clean reinstall of Qt:

    yes a have full qt package (MSVC, MING32 and 64, ANDROID...). MINGW32bit works fine, for example.

    You might have Qt DLLs that were built with MinGW 32-bit in your PATH.

    Download the Dependencies app (https://github.com/lucasg/Dependencies ), run DependenciesGui.exe, and use it to analyze your MinGW x64 version of qwindows.dll (or analyze your executable). Do you notice anything?


Log in to reply