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

bug for static compile



  • I use vs2017 in my work under Windows,I need /Mt to compile my project, but QT default compile is /Md.
    I have to recompile QT with static mode,I config it such as:
    configure -confirm-license -opensource -debug-and-release -static -static-runtime -force-debug-info -nomake examples -nomake tests -prefix D:/qt/Qt5.10.1_static
    After a long compile time,I got static version QT.
    I make a empty project,compile and run,i got a fatal!
    I try to debug it,

    qguiapplication:
    static void init_platform(const QString &pluginArgument, const QString &platformPluginPath, const QString &platformThemeName, int &argc, char **argv)
    {
    ...
        QGuiApplicationPrivate::platform_integration = QPlatformIntegrationFactory::create(name, arguments, argc, argv, platformPluginPath);
        if (Q_UNLIKELY(!QGuiApplicationPrivate::platform_integration)) {
    ...
    }
    the platform_integration is null, then fatal!
    but in qfactoryloader.cpp:
    void QFactoryLoader::update()
    {
    #ifdef QT_SHARED
    ...
    #else
        Q_D(QFactoryLoader);
        if (qt_debug_component()) {
            qDebug() << "QFactoryLoader::QFactoryLoader() ignoring" << d->iid
                     << "since plugins are disabled in static builds";
        }
    #endif
    

    the QFactoryLoader think "plugins are disabled in static builds",but init_platform doesn't think so.
    I don't known how to fix it.


Log in to reply