Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Plugin loading fails
Forum Updated to NodeBB v4.3 + New Features

Plugin loading fails

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 2 Posters 1.6k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • JanWJ Offline
    JanWJ Offline
    JanW
    wrote on last edited by
    #1

    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...

    1 Reply Last reply
    0
    • JanWJ Offline
      JanWJ Offline
      JanW
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        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 :)

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved