<html><body><div>Hello,<br><br><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style="color: rgb(6, 6, 6);">I use Qt 4.8.0 from the QtSDK and I </span>want to generate a static qt plugin.<br>In my main.cpp I have the following:<br></pre><br><span style="font-family: courier new,monospace; font-size: 12px;"><span data-mce-style="color: #000080;" style="color: rgb(0, 0, 128);">#include</span><span data-mce-style="color: #c0c0c0;" style="color: rgb(192, 192, 192);"> </span><span data-mce-style="color: #008000;" style="color: rgb(0, 128, 0);"><QApplication><br></span><span data-mce-style="color: #000080;" style="color: rgb(0, 0, 128);">#include</span><span data-mce-style="color: #c0c0c0;" style="color: rgb(192, 192, 192);"> </span><span data-mce-style="color: #008000;" style="color: rgb(0, 128, 0);"><QtPlugin><br><br></span>

</span><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style="font-family: courier new,monospace; font-size: 12px;"><span data-mce-style="color: #800080;" style="color: rgb(128, 0, 128);">Q_IMPORT_PLUGIN</span><span data-mce-style="color: #000000;" style="color: rgb(0, 0, 0);">(</span>Local<span data-mce-style="color: #000000;" style="color: rgb(0, 0, 0);">)<br><br></span></span></pre><span style="font-family: courier new,monospace; font-size: 12px;"><span data-mce-style="color: #808000;" style="color: rgb(128, 128, 0);">int</span><span data-mce-style="color: #c0c0c0;" style="color: rgb(192, 192, 192);"> </span>main<span data-mce-style="color: #000000;" style="color: rgb(0, 0, 0);">(</span><span data-mce-style="color: #808000;" style="color: rgb(128, 128, 0);">int</span><span data-mce-style="color: #c0c0c0;" style="color: rgb(192, 192, 192);"> </span><span data-mce-style="color: #000000;" style="color: rgb(0, 0, 0);">argc</span><span data-mce-style="color: #000000;" style="color: rgb(0, 0, 0);">,</span><span data-mce-style="color: #c0c0c0;" style="color: rgb(192, 192, 192);"> </span><span data-mce-style="color: #808000;" style="color: rgb(128, 128, 0);">char</span><span data-mce-style="color: #000000;" style="color: rgb(0, 0, 0);">*</span><span data-mce-style="color: #c0c0c0;" style="color: rgb(192, 192, 192);"> </span><span data-mce-style="color: #000000;" style="color: rgb(0, 0, 0);">argv</span><span data-mce-style="color: #000000;" style="color: rgb(0, 0, 0);">[])</span><span data-mce-style="color: #c0c0c0;" style="color: rgb(192, 192, 192);"> </span><span data-mce-style="color: #000000;" style="color: rgb(0, 0, 0);">{<br></span><span data-mce-style="color: #c0c0c0;" style="color: rgb(192, 192, 192);">    </span><span data-mce-style="color: #c0c0c0;" style="color: rgb(192, 192, 192);"></span><span data-mce-style="color: #800080;" style="color: rgb(128, 0, 128);">QApplication</span><span data-mce-style="color: #c0c0c0;" style="color: rgb(192, 192, 192);"> </span><span data-mce-style="color: #000000;" style="color: rgb(0, 0, 0);">app</span><span data-mce-style="color: #000000;" style="color: rgb(0, 0, 0);">(</span><span data-mce-style="color: #000000;" style="color: rgb(0, 0, 0);">argc</span><span data-mce-style="color: #000000;" style="color: rgb(0, 0, 0);">,</span><span data-mce-style="color: #c0c0c0;" style="color: rgb(192, 192, 192);"> </span><span data-mce-style="color: #000000;" style="color: rgb(0, 0, 0);">argv</span><span data-mce-style="color: #000000;" style="color: rgb(0, 0, 0);">);</span>
</span><pre style="margin: 0px; text-indent: 0px;"><span style="font-family: courier new,monospace; font-size: 12px;">    .</span><br><span style="font-family: courier new,monospace; font-size: 12px;">    .</span><br><span style="font-family: courier new,monospace; font-size: 12px;">    .
</span><style type="text/css">
p, li { white-space: pre-wrap; }
</style><span style="font-family: courier new,monospace; font-size: 12px;">    <span data-mce-style="color: #c0c0c0;" style="color: rgb(192, 192, 192);"></span><span data-mce-style="color: #808000;" style="color: rgb(128, 128, 0);">return</span><span data-mce-style="color: #c0c0c0;" style="color: rgb(192, 192, 192);"> </span><span data-mce-style="color: #000000;" style="color: rgb(0, 0, 0);">app</span><span data-mce-style="color: #000000;" style="color: rgb(0, 0, 0);">.</span>exec<span data-mce-style="color: #000000;" style="color: rgb(0, 0, 0);">();</span></span><br></pre><span data-mce-style="color: #000000;" style="color: rgb(0, 0, 0);"><span style="font-family: courier new,monospace; font-size: 12px;">}</span><br><br>The corresponding CMakeLists.txt for the LocalPlugin looks like the following:<br><br></span><span style="font-size: 12px; font-family: courier new,monospace;"><span data-mce-style="color: #808000;" style="color: rgb(128, 128, 0);">SET</span>(LOCALPLUGIN_HEADERS

</span><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style="font-size: 12px; font-family: courier new,monospace;"><span data-mce-style="color: #c0c0c0;" style="color: rgb(192, 192, 192);">    </span>LocalPlugin.h</span></pre>

<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style="font-size: 12px; font-family: courier new,monospace;">)</span><br><br></pre>

<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style="font-size: 12px; font-family: courier new,monospace;"><span data-mce-style="color: #808000;" style="color: rgb(128, 128, 0);">SET</span>(LOCALPLUGIN_SOURCES</span></pre>

<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style="font-size: 12px; font-family: courier new,monospace;"><span data-mce-style="color: #c0c0c0;" style="color: rgb(192, 192, 192);">    </span>LocalPlugin.cpp</span></pre>

<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style="font-size: 12px; font-family: courier new,monospace;">)</span></pre><br><span style="font-size: 12px; font-family: courier new,monospace;"><span data-mce-style="color: #808000;" style="color: rgb(128, 128, 0);">SET</span>(QT_USE_QTGUI<span data-mce-style="color: #c0c0c0;" style="color: rgb(192, 192, 192);"> </span>TRUE)<span data-mce-style="color: #808000;" style="color: rgb(128, 128, 0);"><br>SET</span>(QT_USE_QTPLUGIN<span data-mce-style="color: #c0c0c0;" style="color: rgb(192, 192, 192);"> </span>TRUE)</span><br><br><span style="font-size: 12px; font-family: courier new,monospace;"><span data-mce-style="color: #808000;" style="color: rgb(128, 128, 0);">QT4_AUTOMOC</span>(<span data-mce-style="color: #800000;" style="color: rgb(128, 0, 0);">${LOCALPLUGIN_SOURCES}</span>)</span><br><span style="font-size: 12px; font-family: courier new,monospace;"><span data-mce-style="color: #808000;" style="color: rgb(128, 128, 0);">QT4_WRAP_CPP</span>(LOCALPLUGIN_MOC<span data-mce-style="color: #c0c0c0;" style="color: rgb(192, 192, 192);"> </span><span data-mce-style="color: #800000;" style="color: rgb(128, 0, 0);">${LOCALPLUGIN_HEADERS}</span>)

</span><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style="font-size: 12px; font-family: courier new,monospace;"><span data-mce-style="color: #808000;" style="color: rgb(128, 128, 0);">ADD_LIBRARY</span>(Local<span data-mce-style="color: #c0c0c0;" style="color: rgb(192, 192, 192);"> </span>STATIC<span data-mce-style="color: #c0c0c0;" style="color: rgb(192, 192, 192);"> </span><span data-mce-style="color: #800000;" style="color: rgb(128, 0, 0);">${LOCALPLUGIN_HEADERS}</span><span data-mce-style="color: #c0c0c0;" style="color: rgb(192, 192, 192);"> </span><span data-mce-style="color: #800000;" style="color: rgb(128, 0, 0);">${LOCALPLUGIN_SOURCES}</span><span data-mce-style="color: #c0c0c0;" style="color: rgb(192, 192, 192);"> </span><span data-mce-style="color: #800000;" style="color: rgb(128, 0, 0);"></span><span data-mce-style="color: #800000;" style="color: rgb(128, 0, 0);">${LOCALPLUGIN_MOC}</span>)</span></pre>
<pre style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style="font-size: 12px; font-family: courier new,monospace;"><span data-mce-style="color: #808000;" style="color: rgb(128, 128, 0);">TARGET_LINK_LIBRARIES</span>(Local<span data-mce-style="color: #c0c0c0;" style="color: rgb(192, 192, 192);"> </span><span data-mce-style="color: #c0c0c0;" style="color: rgb(192, 192, 192);"></span></span><span style="font-family: courier new,monospace; font-size: 12px;"><span data-mce-style="color: #c0c0c0;" style="color: rgb(192, 192, 192);"></span><span data-mce-style="color: #800000;" style="color: rgb(128, 0, 0);">${QT_LIBRARIES}</span></span><span style="font-size: 12px; font-family: courier new,monospace;">)</span></pre><br><span style="color: rgb(0, 0, 0);">The corresponding CMakeLists.txt for the main app looks like the following:</span><br><br><span style="font-family: courier new,monospace; font-size: 12px;"><span data-mce-style="color: #808000;" style="color: rgb(128, 128, 0);">SET</span>(QT_USE_QTMAIN<span data-mce-style="color: #c0c0c0;" style="color: rgb(192, 192, 192);"> </span>TRUE)
</span><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style="font-family: courier new,monospace; font-size: 12px;"><span data-mce-style="color: #808000;" style="color: rgb(128, 128, 0);">SET</span>(QT_USE_QTGUI<span data-mce-style="color: #c0c0c0;" style="color: rgb(192, 192, 192);"> </span>TRUE)</span><br><br><span style="font-family: courier new,monospace; font-size: 12px;"><span data-mce-style="color: #808000;" style="color: rgb(128, 128, 0);">ADD_EXECUTABLE</span>(MyApp WIN32<span data-mce-style="color: #c0c0c0;" style="color: rgb(192, 192, 192);"> </span><span data-mce-style="color: #800000;" style="color: rgb(128, 0, 0);">${APP_SOURCES}</span><span data-mce-style="color: #c0c0c0;" style="color: rgb(192, 192, 192);"> </span><span data-mce-style="color: #800000;" style="color: rgb(128, 0, 0);">${APP_RCC}</span><span data-mce-style="color: #c0c0c0;" style="color: rgb(192, 192, 192);"> </span>MyApp.rc)</span><br><span style="font-family: courier new,monospace; font-size: 12px;"><span data-mce-style="color: #808000;" style="color: rgb(128, 128, 0);">TARGET_LINK_LIBRARIES</span>(MyApp <span data-mce-style="color: #c0c0c0;" style="color: rgb(192, 192, 192);"></span>Local<span data-mce-style="color: #c0c0c0;" style="color: rgb(192, 192, 192);"> </span><span data-mce-style="color: #800000;" style="color: rgb(128, 0, 0);">${QT_LIBRARIES}</span>)</span><br><br>When I compile it I get the following error:<br><span style="color: rgb(6, 6, 6);"><span style="font-size: 12px; font-family: courier new,monospace;">In function `StaticLocalPluginInstance': undefined reference to `qt_plugin_instance_Local()'</span><br><br>Please, could anybody help me to get it working?<br><br>Thanks in advance<br><br>Best Regards<br>NoRulez<br></span></pre><br><pre style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></pre></pre><span style=" color:#000000;"></span></div></body></html>