[QBS] Missing metadata URI in static plugin

Christian Kandeler christian.kandeler at qt.io
Mon Jul 25 16:27:28 CEST 2016

On 07/25/2016 04:01 PM, Dennis Tomas wrote:
> Hello,
> I am trying to build a static QML plugin and a test application using
> it. So far, I have succeeded in building the plugin and application, but
> when I try to run it (using qbs run), I get the following error message:
> file:///home/dt/work/testqtplugin/test/tst_foo.qml:3:1: static plugin
> for module "myplugin" with name "MyPlugin" has no metadata URI
>      import myplugin 1.0
>      ^
> ********* Start testing of myplugin *********
> Config: Using QtTest library 5.7.0, Qt 5.7.0 (x86_64-little_endian-lp64
> shared (dynamic) release build; by GCC 4.9.1 20140922 (Red Hat 4.9.1-10))
> QWARN  : myplugin::tst_foo::compile()
>   /home/dt/work/testqtplugin/test/tst_foo.qml produced 1 error(s):
>     /home/dt/work/testqtplugin/test/tst_foo.qml:3,1: static plugin for
> module "myplugin" with name "MyPlugin" has no metadata URI
>   Working directory: /home/dt/work/testqtplugin
>   View: QQuickView, import paths:
>     '/home/dt/work/testqtplugin/qt5-debug/install-root/bin'
>     'qrc:/qt-project.org/imports'
>     '/home/dt/Qt/5.7/gcc_64/qml'
>   Plugin paths:
>     '.'
> With QMake, the solution was adding 'QMAKE_MOC_OPTIONS +=
> -Muri=myplugin' to the .pro file. How can I do this in Qbs?

Hm, it appears we have no property for setting arbitrary moc flags. Can 
you please file a bug report?
As for possible workarounds, the gerrit page for the commit that 
introduced the -M flag to moc discusses alternatives:


More information about the Qbs mailing list