PDA

View Full Version : Plugin loading fails



JanW
19th July 2016, 09:38
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\Arc GISRuntimePlugind.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::app licationDirPath()).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;
}


Jan

Ps: They don't use VS themselves so they could not help me with the issue...

anda_skoa
19th July 2016, 10:51
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\Arc GISRuntimePlugind.dll: The specified module could not be found. (the dll is there at that location)

You could try setting the environment variable QT_DEBUG_PLUGINS to 1 and see if this gives you more hints in the application's log output.



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.

Since there is no such thing as "the" vs compiler as they are basically all incompatible with each other, check that it is exactly the same version, bit-ness, etc.



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?

You could check the environment in QtCreator's project/run settings so see if your VS setup is missing any of these are has different values.

Cheers,
_

JanW
19th July 2016, 11:35
You could try setting the environment variable QT_DEBUG_PLUGINS to 1 and see if this gives you more hints in the application's log output.

Found metadata in lib C:/Qt/5.7/msvc2013_64/qml/ArcGIS/Runtime.10.26/ArcGISRuntimePlugind.dll, metadata=
{
"IID": "org.qt-project.Qt.QQmlExtensionInterface",
"MetaData": {
},
"className": "ArcGISRuntimePlugin",
"debug": true,
"uri": [
"ArcGIS.Runtime"
],
"version": 328705
}

seems like it correctly finds the dll. That's all the extra information.

Since there is no such thing as "the" vs compiler as they are basically all incompatible with each other, check that it is exactly the same version, bit-ness, etc.
Well, on their website (https://developers.arcgis.com/qt/qml/guide/arcgis-runtime-sdk-for-qt-system-requirements.htm#ESRI_SECTION1_AFCD25C9453346ED892 C54669B264AF5) they say Visual Studio 2013 is a prerequisite and in their installer I can choose to install for msvc 32 bit or 64 bit (i've chosen the 64 bit version).
Dumpbin.exe gives me also linker version 12.0 and machine x64. So i'm quite sure they use the same compiler as I do (ofcourse not 100%)


You could check the environment in QtCreator's project/run settings so see if your VS setup is missing any of these are has different values.
For the build settings i see: qmake.exe C:\Work\Development\Elsyca\ArcGisTest\QMLTest\QMLT est.pro -r -spec win32-msvc2013 "CONFIG+=debug" "CONFIG+=declarative_debug" "CONFIG+=qml_debug". The win32-msvc2013 means it uses the 32 bit version of the compiler, not that it compiles to 32 bit i guess...
The working dir is different, but changing it, doesn't make a difference and for the run environment it says system environment.
I don't see any other differences, but i'm not so familiar with qt creator, maybe i'm missing something...

anda_skoa
19th July 2016, 12:42
Found metadata in lib C:/Qt/5.7/msvc2013_64/qml/ArcGIS/Runtime.10.26/ArcGISRuntimePlugind.dll, metadata=
{
"IID": "org.qt-project.Qt.QQmlExtensionInterface",
"MetaData": {
},
"className": "ArcGISRuntimePlugin",
"debug": true,
"uri": [
"ArcGIS.Runtime"
],
"version": 328705
}

seems like it correctly finds the dll. That's all the extra information.

Right.



Well, on their website (https://developers.arcgis.com/qt/qml/guide/arcgis-runtime-sdk-for-qt-system-requirements.htm#ESRI_SECTION1_AFCD25C9453346ED892 C54669B264AF5) they say Visual Studio 2013 is a prerequisite and in their installer I can choose to install for msvc 32 bit or 64 bit (i've chosen the 64 bit version).
Dumpbin.exe gives me also linker version 12.0 and machine x64. So i'm quite sure they use the same compiler as I do (ofcourse not 100%)




For the build settings i see: qmake.exe C:\Work\Development\Elsyca\ArcGisTest\QMLTest\QMLT est.pro -r -spec win32-msvc2013 "CONFIG+=debug" "CONFIG+=declarative_debug" "CONFIG+=qml_debug". The win32-msvc2013 means it uses the 32 bit version of the compiler, not that it compiles to 32 bit i guess...
The working dir is different, but changing it, doesn't make a difference and for the run environment it says system environment.
I don't see any other differences, but i'm not so familiar with qt creator, maybe i'm missing something...

Hmm, maybe the Debug build?

Cheers,
_

JanW
19th July 2016, 12:53
Hmm, maybe the Debug build?
_

Debug, Release, doesn't make a difference (same error). In release the error is "...loadPlugin failed on "C:/Qt/5.7/msvc2013_64/qml/ArcGIS/Runtime.10.26/ArcGISRuntimePlugin.dll"... " so the release dll is taken (and since they provide ArcGISRuntimePlugind.dll and ArcGISRuntimePlugin.dll, I guess their build settings are also correct).

anda_skoa
19th July 2016, 13:47
Right.

Sorry, out of ideas due to lack of knowledge on Windows tools.

On Linux I would have checked next if the plugin DLL has all its dependencies satisfied and looked at the debug log of the runtime linker.

Cheers,
_

JanW
19th July 2016, 14:15
Pfff, I opened the dll with depends.exe and put all depending dlls right next to the original dll and now it works.
Thank you very much for the hint of checking dependencies!
Kind regards,

Jan