Important: Please read the Qt Code of Conduct -

Qml plugin cannot be loaded in my qml project

  • in qml file of qml project:
    import 1.5
    when I run it in creator, it outputs:
    plugin cannot be loaded for module " ": Cannot load library D:/brooks/com/groveil/tools/Button.dll: ?ò2?μ????¨μ??£?é?£
    in com/groveil/tools directory, there's a qmldir file,contents is simple like this: plugin Button
    plugin C++ implementation is also simple.

    class BUTTON_EXPORT ButtonPlugin : public QDeclarativeExtensionPlugin
    void registerTypes(const char *uri)
    Q_ASSERT(QLatin1String(uri) == QLatin1String(" "));

    qmlRegisterType<Button>(" ", 1, 5, "Button");

    Q_EXPORT_PLUGIN2(Button, ButtonPlugin);

    I don't know what's wrong?

    I find if I create a plugin which don't rely on other dlls, it can be loaded;
    here my plugin relys on another dll, even though I copy the another dll into the same directory of plugin, but plugin still can't be loaded.
    [EDIT: code formatting, please wrap in @-tags, Volker]

Log in to reply