mingw-cross-env-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Mingw-cross-env-list] Building fully static builds of Qt5 issues


From: N. N.
Subject: Re: [Mingw-cross-env-list] Building fully static builds of Qt5 issues
Date: Wed, 22 Oct 2014 17:13:10 +0000 (UTC)

On 10/22/2014 7:54 AM, Martin Müllenhaupt wrote:
> I didn't use Qt5 yet, but for Qt4, there was some special code needed to init 
> static qt plugins.
> The issue is described here: 
> http://qt-project.org/doc/qt-4.8/plugins-howto.html#static-plugins
>
> And this is the example they gave:
>
> #include <QApplication>
> #include <QtPlugin>
>
> Q_IMPORT_PLUGIN(qjpeg)
> Q_IMPORT_PLUGIN(qgif)
> Q_IMPORT_PLUGIN(qkrcodecs)
>
> int main(int argc, char *argv[])
> {
>     QApplication app(argc, argv);
>     ...
>     return app.exec();
> }
>
> The qt5-doc 
> (http://qt-project.org/doc/qt-5/plugins-howto.html#static-plugins) states, 
> that the 
> Q_IMPORT_PLUGIN() code is automatically generated by qmake. Maybe you are not 
> using qmake or qmake is doing something wrong.
>

After much digging, I am using Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin), 
however, I am not using qmake, using automake.

Now, it finally does work, but, ran into another issue that isn't MXE related 
(at least, I don't think so), so, going off to the Qt forums/ML... it has to do 
with adding conditional preprocessors around the plugin lines, and that causes 
the same initial issues of it wanting the 'windows' plugin.

Thanks for the responses!

For those that are curious, my version is:

#include <QtWidgets/QApplication>
#include <QtCore/QtPlugin>
...
...
Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)
...
...
int main(int argc, char *argv[])
{
...
}


added -DQT_STATICPLUGIN and linked with -lQt5PlatformSupport -lqwindows (rest 
of QT5 libs)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]