[Interest] How to deploy a qml app with Qt built statically?

Nuno Santos nunosantos at imaginando.pt
Fri May 22 19:58:05 CEST 2015


Hi,

I have a tried all the ways and means. I can have the linker to link 
successfully. I have decided to use qico plugin just to be even simpler.

c++ source file:

#include <QtPlugin>
Q_IMPORT_PLUGIN(qico)

.pro file:

QTPLUGIN += qico

win32 {
     CONFIG += dll
     LIBS += qico.lib
}

build output:

error LNK2019: unresolved external symbol "struct QStaticPlugin const 
__cdecl qt_static_plugin_qico(void)" 
(?qt_static_plugin_qico@@YA?BUQStaticPlugin@@XZ) referenced in function 
"public: __thiscall 
StaticqicoPluginInstance::StaticqicoPluginInstance(void)" 
(??0StaticqicoPluginInstance@@QAE at XZ)

Any ideas?

Regards,

Nuno

On 22/05/2015 17:44, Thiago Macieira wrote:
> On Friday 22 May 2015 16:37:27 Nuno Santos wrote:
>> Hi,
>>
>> I have compiled Qt statically. In this process I have found two
>> difficulties:
>>
>> - If I don't compile it with -developer-build I don't have the plugins
>> compiled
> That's a bug, please report.
>
>> - When I finally got plugins compiled, they are static libs
> Of course.
>
>> When my program is about to start it asks about plugin windows (i assume
>> it is the platforms/qwindows.dll)
> Which is a static library that you need to link into your application. Qmake
> has some logic to automatically process staticplugins.
>
>> What is the process to deploy an application with a static build of qt?
> Try a lot and figure it out for the plugins. Make sure they are getting linked
> into your binary and make sure they are getting initialised too. For each
> staticplugin, qmake should generate an extra .cpp file that calls a function
> from the plugin to register itself.
>
> In order to do that, you need to list all plugins you want to use in a
> variable (I don't remember the name, it must be in the docs).
>




More information about the Interest mailing list