Results 1 to 7 of 7

Thread: Plugin loading fails

  1. #1
    Join Date
    Jan 2008
    Posts
    20
    Thanks
    1

    Default 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\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...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:

    Qt Code:
    1. import QtQuick 2.3
    2. import QtQuick.Controls 1.2
    3. import ArcGIS.Runtime 10.26
    4.  
    5. ApplicationWindow {
    6. id: appWindow
    7. width: 800
    8. height: 600
    9. title: "TestApp"
    10.  
    11. Map {
    12. anchors.fill: parent
    13.  
    14. focus: true
    15.  
    16. ArcGISTiledMapServiceLayer {
    17. url: "http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"
    18. }
    19. }
    20. }
    To copy to clipboard, switch view to plain text mode 

    Main.cpp:
    Qt Code:
    1. int main(int argc, char *argv[])
    2. {
    3. QGuiApplication app(argc, argv);
    4.  
    5. QQmlApplicationEngine appEngine;
    6. appEngine.addImportPath(QDir(QCoreApplication::applicationDirPath()).filePath("qml");
    7. appEngine.load(QUrl(kApplicationSourceUrl));
    8.  
    9. auto topLevelObject = appEngine.rootObjects().value(0);
    10. qDebug() << Q_FUNC_INFO << topLevelObject;
    11.  
    12. auto window = qobject_cast<QQuickWindow *>(topLevelObject);
    13. if (!window)
    14. {
    15. qCritical("Error: Your root item has to be a Window.");
    16.  
    17. return -1;
    18. }
    To copy to clipboard, switch view to plain text mode 

    Jan

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

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Plugin loading fails

    Quote Originally Posted by JanW View Post
    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.

    Quote Originally Posted by JanW View Post
    According to their install instructions (https://developers.arcgis.com/qt/qml...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.

    Quote Originally Posted by JanW View Post
    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,
    _

  3. #3
    Join Date
    Jan 2008
    Posts
    20
    Thanks
    1

    Default Re: Plugin loading fails

    Quote Originally Posted by anda_skoa View Post
    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.
    Quote Originally Posted by anda_skoa View Post
    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...2C54669B264AF5) 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%)

    Quote Originally Posted by anda_skoa View Post
    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...

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Plugin loading fails

    Quote Originally Posted by JanW View Post
    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.

    Quote Originally Posted by JanW View Post
    Well, on their website (https://developers.arcgis.com/qt/qml...2C54669B264AF5) 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%)
    Quote Originally Posted by JanW View Post
    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,
    _

  5. #5
    Join Date
    Jan 2008
    Posts
    20
    Thanks
    1

    Default Re: Plugin loading fails

    Quote Originally Posted by anda_skoa View Post
    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).

  6. #6
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Plugin loading fails

    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,
    _

  7. The following user says thank you to anda_skoa for this useful post:

    JanW (19th July 2016)

  8. #7
    Join Date
    Jan 2008
    Posts
    20
    Thanks
    1

    Default Re: Plugin loading fails

    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

Similar Threads

  1. OSX Plugin deployment fails
    By mpita in forum Qt Programming
    Replies: 0
    Last Post: 5th October 2011, 16:38
  2. QWebView page loading fails after file downloading
    By mentalmushroom in forum Qt Programming
    Replies: 1
    Last Post: 18th August 2011, 14:57
  3. Problem in building outside source directory(loading qrc files fails)
    By Jayakrishnan in forum Installation and Deployment
    Replies: 3
    Last Post: 17th October 2009, 16:00
  4. designer plugin fails to load
    By ModeZt in forum Qwt
    Replies: 6
    Last Post: 4th February 2008, 21:08
  5. Building of MySQL plugin fails
    By janca in forum Installation and Deployment
    Replies: 2
    Last Post: 21st January 2006, 08:23

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.