Hi
I have created a custom map tiles engine in C++, which works well when compiled as a dynamic library and imported into a QML app on the simulator.
I wish however to have it as a static library, and bundle it in with my app... I can't get this to work.
My plugin's .pro file has the following lines
I also have the following line in one of the .cpp files:Code:TARGET = MyMaps CONFIG += staticlib mobility MOBILITY += location
Building this seems to work OK, a libMyMaps.a file is produced.Code:Q_EXPORT_PLUGIN2(MyMaps, QMyMappingProvider)
However I am having difficulty using it in my QML app.
My QML app's .pro file has the following lines
It builds OK, but when I run it, it crashes when loading my QML file. It contains the following:Code:LIBS += \QtWorkspace\MyMaps-build-simulator\debug\libMyMaps.a
I have tried including the lineCode:Map { plugin: Plugin { name: "mymaps" } }
in my application's main.cpp, however this will not build, I get the error:Code:Q_IMPORT_PLUGIN(MyMaps)
Again, the plugin works well when included as a dynamic library!Code:undefined reference to `qt_plugin_instance_MyMaps()'
How can I bundle this static library with my app? Must I have it as a separate plugin? It would be much cleaner for me to have it all as one project.
Help appreciated.




