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. Can't import QtPositioning - "The specified module cannot be found", but module exists

Can't import QtPositioning - "The specified module cannot be found", but module exists

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
5 Posts 2 Posters 1.2k Views 1 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.
  • C Offline
    C Offline
    christian.l
    wrote on last edited by christian.l
    #1

    Hi, I'm trying to import QtPositioning to a QML file with Qt 5.12.3. I'm building the project using a CMake file. When I try to run the program, I get the following error:

    QQmlApplicationEngine failed to load component
    qrc:/main.qml:3 plugin cannot be loaded for module "QtPositioning": Cannot load library D:\Dev\MyProject\build\bin\qml\QtPositioning\declarative_positioningd.dll: The specified module could not be found.

    Problem is, that dll exists at that location. This error message is very unhelpful and I do not know how to debug this issue. I've posted the source of all my relevant files here at Stack Overflow. I've also seen this similar post but the solution given does not work for me, the Qt5PositioningQuick.dll file is also present. Lastly I've seen this seemingly related bug, but not only does the fix not work for me, it should be fixed in >5.6 and I'm on 5.12.3.

    Please help.

    EDIT: I've just tried this in Qt Creator and it worked fine, so I suspect this has something to do with CMake. However, I've also tried adding Positioning to my imported modules in CMake to no avail. Unless I got the module name wrong or something, I don't know what else I can do there.

    raven-worxR 1 Reply Last reply
    0
    • C christian.l

      Hi, I'm trying to import QtPositioning to a QML file with Qt 5.12.3. I'm building the project using a CMake file. When I try to run the program, I get the following error:

      QQmlApplicationEngine failed to load component
      qrc:/main.qml:3 plugin cannot be loaded for module "QtPositioning": Cannot load library D:\Dev\MyProject\build\bin\qml\QtPositioning\declarative_positioningd.dll: The specified module could not be found.

      Problem is, that dll exists at that location. This error message is very unhelpful and I do not know how to debug this issue. I've posted the source of all my relevant files here at Stack Overflow. I've also seen this similar post but the solution given does not work for me, the Qt5PositioningQuick.dll file is also present. Lastly I've seen this seemingly related bug, but not only does the fix not work for me, it should be fixed in >5.6 and I'm on 5.12.3.

      Please help.

      EDIT: I've just tried this in Qt Creator and it worked fine, so I suspect this has something to do with CMake. However, I've also tried adding Positioning to my imported modules in CMake to no avail. Unless I got the module name wrong or something, I don't know what else I can do there.

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @christian.l
      are you trying to run a deployed application (outside of QtCreator)?
      If so you have to copy the (corresponding) contents of QTDIR/qml next to your executable or set a QML import path accordingly.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      C 1 Reply Last reply
      0
      • raven-worxR raven-worx

        @christian.l
        are you trying to run a deployed application (outside of QtCreator)?
        If so you have to copy the (corresponding) contents of QTDIR/qml next to your executable or set a QML import path accordingly.

        C Offline
        C Offline
        christian.l
        wrote on last edited by
        #3

        @raven-worx I'm using Visual Studio with CMake. Qt Creator and .pro files are not involved whatsoever.

        I've just tried both of those options, but neither solves the problem. I get the same error message.

        raven-worxR 1 Reply Last reply
        0
        • C christian.l

          @raven-worx I'm using Visual Studio with CMake. Qt Creator and .pro files are not involved whatsoever.

          I've just tried both of those options, but neither solves the problem. I get the same error message.

          raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by raven-worx
          #4

          @christian.l said in Can't import QtPositioning - "The specified module cannot be found", but module exists:

          I've just tried both of those options

          What have you tried exactly?
          Settings an environment variable or call QQmlEngine::addImportPath() is the easiest way.

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          C 1 Reply Last reply
          0
          • raven-worxR raven-worx

            @christian.l said in Can't import QtPositioning - "The specified module cannot be found", but module exists:

            I've just tried both of those options

            What have you tried exactly?
            Settings an environment variable or call QQmlEngine::addImportPath() is the easiest way.

            C Offline
            C Offline
            christian.l
            wrote on last edited by
            #5

            @raven-worx I tried copying the QtPositioning folder next to my executable with no luck. I then tried setting my QML2_IMPORT_PATH environment variable to <QTDIR>/qml.

            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