Unsolved Plugin loading fails
-
Hi,
for one of our projects we are using a thirdparty qml plugin. They provide an installer which installs a folder in C:\Qt\5.7\msvc2013_64\qml(\ArcGIS...), a folder in C:\program files and adds a template project to qt creator. When I create a sample project with their template in qt creator and build/run it, everything works fine. When I use the Qt VS add in to convert it to a vs project, it compiles, but when it runs i get the following error:
QQmlApplicationEngine failed to load component
qrc:/qml/main.qml:16 plugin cannot be loaded for module "ArcGIS.Runtime": Cannot load library C:\Qt\5.7\msvc2013_64\qml\ArcGIS\Runtime.10.26\ArcGISRuntimePlugind.dll: The specified module could not be found. (the dll is there at that location)
int __cdecl main(int,char *[]) QObject(0x0)
Error: Your root item has to be a Window.According to their install instructions (https://developers.arcgis.com/qt/qml/guide/install-and-set-up-on-windows.htm) they use the vs compiler in qt creator to compile the projects, so i guess it's not a compiler compatibility issue.
What can be the difference between the qt creator project and the vs project? Are there some input paths that are different or so? Anybody an idea?
Here's the code:
main.qml:
import QtQuick 2.3 import QtQuick.Controls 1.2 import ArcGIS.Runtime 10.26 ApplicationWindow { id: appWindow width: 800 height: 600 title: "TestApp" Map { anchors.fill: parent focus: true ArcGISTiledMapServiceLayer { url: "http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" } } }
Main.cpp:
int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); QQmlApplicationEngine appEngine; appEngine.addImportPath(QDir(QCoreApplication::applicationDirPath()).filePath("qml"); appEngine.load(QUrl(kApplicationSourceUrl)); auto topLevelObject = appEngine.rootObjects().value(0); qDebug() << Q_FUNC_INFO << topLevelObject; auto window = qobject_cast<QQuickWindow *>(topLevelObject); if (!window) { qCritical("Error: Your root item has to be a Window."); return -1; }
Ps: They don't use VS themselves so they could not help me with the issue...
-
Pfff, I opened the dll with depends.exe and put all depending dlls right next to the original dll and now it works. Stupid me
Jan -
Hi,
Glad you found out and thanks for sharing.
Since you have it working now, please mark the thread as solved using the "Topic Tools" button so that other forum users may know a solution has been found :)