Problems with Open-Source Downloads read and

Plugin cannot be loaded for module

  • Hi there!

    I created a QML Extension Plugin containing a QWidget (containing the interface down to the hardware API) through a QGraphicsProxyWidget.

    QML file looks like:

    @import QtQuick 1.0
    import "ImagerPlugin" 1.0

    Rectangle {
    width: 640
    height: 480
    ImagerWgt {
    anchors.fill: parent

    Module is located at

    • qmlimagerplugin.dll
    • qmldir


    @plugin qmlimagerplugin@

    qmlImagerPlugin.cpp: (Containing the plugin relevant code)

    @#include <QtDeclarative/QDeclarativeExtensionPlugin>
    #include <QtDeclarative/qdeclarative.h>
    #include <QtGui/QGraphicsProxyWidget>
    #include "WgtImager.h"

    class imagerWgtProxy : public QGraphicsProxyWidget
    explicit imagerWgtProxy(QGraphicsItem *parent = 0)
    : QGraphicsProxyWidget(parent)
    imager = new WgtImager();

    WgtImager *imager;



    class imagerPlugin : public QDeclarativeExtensionPlugin

    void registerTypes(const char *uri)
    qmlRegisterType<imagerWgtProxy>(uri, 1, 0, "ImagerWgt");

    #include "qmlImagerPlugin.moc"

    Here comes the output of the SerialConsole of my WindowsMobile 6.5 Prof Emulator:

    @CertVerify: Storage CardTestImagerqmlView.exe trust = 2
    CertVerify: QtDeclaratived4.dll trust = 2
    CertVerify: QtScriptd4.dll trust = 2
    CertVerify: QtCored4.dll trust = 2
    CertVerify: msvcr90d.dll trust = 2
    CertVerify: QtSqld4.dll trust = 2
    CertVerify: QtGuid4.dll trust = 2
    CertVerify: QtNetworkd4.dll trust = 2
    CertVerify: Storage CardTestImagerimagerPluginqmlimagerplugin.dll trust = 2
    file:///Storage Card/TestImager/test.qml:2:1: plugin cannot be loaded for module
    "imagerPlugin": Cannot load library /Storage Card/TestImager/imagerPlugin/qmlim
    agerplugin.dll: The specified module could not be found.
    import "imagerPlugin" 1.0

    QmlView.exe is just a simple QDeclarativeView
    @#include <QApplication>
    #include <QDeclarativeView>
    #include <QDeclarativeContext>
    #include <QDebug>

    int main(int argc, char *argv[])
    QApplication app(argc, argv);
    QDeclarativeView view;
    return app.exec();

    Maybe it's just a wrong naming convention I'm not getting or something...

    Any help would be appreciated ;)


  • Hi,

    The error message looks like it is looking for a lowercase "imagerPlugin" (and path), while the code pasted above is using uppercase "ImagerPlugin". Can you verify if they are being used consistently in the code/directory naming?


  • Thanks for the answer :)

    Was thinking about that as well... so I already tried around a bit (setting everything lowercase, etc.)
    Until now this didn't get me to a loaded module

  • So... I tried putting the qmldir file into the same directory as the loaded qml-File

    So I was thinking the folder structure has to look like this:
    _ qml-Files (importing "ModuleDirectory")
    _ ModuleDirectory
    _ Module-Dlls
    _ qmldir (defining modules in actual directory)

    Now I changed to:
    _ qml-Files (imports)
    _ qmldir (defining module in module-directory)
    _ ModuleDirectory
    _ Module-Dlls

    With the new structure the module dll seems to be loaded, but my ImagerWgt isn't recognized
    @ImagerWgt is not a type@

    Can anyone describe the correct folder structure?
    I was thinking, that both ways are possible - first one would've made more sense in my case...


  • Hm...

    Well, I think, I made a step forward

    I changed the plugin name from imagerPlugin to QImagerPlugin

    Strangely this seems to make a difference (??)
    But maybe recompile + trial'n'error also play a role ;)

    At the moment the win mobile emulator isn't complaining, but I don't get down to to the hardware yet
    I'll change the plugin from being a qwidget to wich the camera video is streamed directly to something like a qmovie, wich accesses a QIOBlockDevice or something...

    Thanks for the moment :)

Log in to reply