I have my own plugin and i want static link it with my application
#includeCode:TEMPLATE = libCONFIG += staticlibIn plugin.cpp: Q_EXPORT_PLUGIN2(plugin, pluginClass)Of course TARGET in .pro file is the same as plugin name. In myapp.pro file: LIBS += libplugin.amain.cpp:
#include Q_IMPORT_PLUGIN(plugin)
int main(int argc, char *argv[]){
QApplication a(argc, argv);
Some code herer
... return a.exec();
}
Plugin compiles without errors, i got *.a and *.o files, so i copied *.a file to myapp directory and when i trying compile i get error like this:
But I am getting the error thatin myapp.pro file and i got in the line with Q_IMPORT_PLUGIN error:Code:cannot find -lmyplugin.acollect2: ld returned 1 exit statusSo i gave full path to libplugin.a
undefined reference to `qt_plugin_instance_plugin()'and much errors like this:
undefined reference to `pluginClass::function()'I included *.h file of my plugin.
What is the wrong I have done please help me
Bookmarks