[Qt-creator] import QtQuick.Extras error

Alvaro Martinez Tovar alvaromartineztovar at yahoo.es
Wed Nov 11 16:41:42 CET 2015


Hello Kai,Thank you very much for your feedback! I am in a hurry to have something running before Nov 25th and I appreciate your collaboration very much.I have tried to investigate a little bit and these are my thoughts so far:
at the host (Ubuntu 14.04) I have the following tree:/home/alvaro/Qt5.5.0/Tools/QtCreator/bin/qml/
..........
├── QtQuick
│   ├── Controls
..........
│   ├── Extras
│   │   ├── designer
│   │   ├── libqtquickextrasplugin.so
│   │   ├── plugins.qmltypes
│   │   └── qmldir
so that QtQuick/Extras folder exists as you suggest. The application runs perfectly.
however, at my yocto distribution, I don't have any Extras directory under 
/usr/lib/qt5/qml/QtQuick/
so I have tried to directly copy the Extras file from the host to the target.It seems that when executing in the target, the application looks there for the module, since the error now is a little bit different:plugin cannot be loaded for module "QtQuick.Extras": '/usr/lib/qt5/qml/QtQuick/Extras/libqtquickextrasplugin.so' is an invalid ELF object (wrong cpu architecture)
I guess that if I could create a proper libqtquickextrasplugin.so file for my ARM architecture (i.MX6 Freescale), the problem could be solved. Do you now how could I do it?The installed sdk is working properly, since I can execute any kind of application in my target. Can I use it somehow to generate the needed plugin?

Regarding building the application statically, I agree with your suggestion and I don't think that this is what we need.
Thank you very much for your help.Best regards,Alvaro Martinez
 

     De: Koehne Kai <Kai.Koehne at theqtcompany.com>
 Para: Alvaro Martinez Tovar <alvaromartineztovar at yahoo.es>; "qt-creator at qt-project.org" <qt-creator at qt-project.org> 
 Enviado: Miércoles 11 de noviembre de 2015 15:46
 Asunto: RE: [Qt-creator] (no subject)
   
Hi!

> -----Original Message-----
> From: Qt-creator [mailto:qt-creator-bounces at qt-project.org] On Behalf Of
> Alvaro Martinez Tovar
> Sent: Wednesday, November 11, 2015 1:16 PM
> To: qt-creator at qt-project.org
> Subject: [Qt-creator] (no subject)
> 
> Hi,

Hi!

> I am quite new to Qt. 

Welcome :)

> I have executed the example application dashboard under
> Qt5.5.0 in Ubuntu and works perfectly! However, when I cross-compile it and try
> to execute it in the embedded target (based on a i.MX6UL), I get the following
> error:
> 
> module "QtQuick.Extras" is not installed

First of all: this is the wrong mailing list, since your problem is not really with Qt Creator. qt-interest would fit better ... Also, give your e-mails please a subject :)

Anyway, what happens for you is that the Qt Quick 2 import "QtQuick.Extras" is not found. The plugin should be located in $[ QT_INSTALL_QML]/ QtQuick\Extras

> do I have to include something else to pro file in order to include this module?

No, there shouldn't be any extra steps required, provided that the Qt on your embedded device was properly set up.

Try to set the QT_IMPORT_TRACE and QT_DEBUG_PLUGINS environment variables to get some more information where it searches the plugins, and maybe why it cannot load it.

> What I have by now is the following:
> 
> TEMPLATE = app
> TARGET = dashboard
> INCLUDEPATH += .
> QT += gui qml quick widgets serialport sql target.path = /home/root INSTALLS +=
> target SOURCES += \
>    main.cpp
> RESOURCES += \
>    dashboard.qrc
> OTHER_FILES += \
>    qml/dashboard.qml \
>    qml/DashboardGaugeStyle.qml \
>    qml/IconGaugeStyle.qml \
>    qml/TachometerStyle.qml \
>    qml/TurnIndicator.qml \
>    qml/ValueSource.qml
> 
> 
> what is really strange for me is that it runs perfectly in Ubuntu, but this error
> appears when deploying to target.
> I have tested some other application and they run correctly in both platforms.
> Could you give me any hint to solve it?
> 
> How could I compile everything together into one executable in order not to
> depend on libraries? Is it possible?

You can indeed build your application statically, but this requires a custom build of Qt, and might be not the best on an embedded platform if you've other Qt processes too.

A good start to read about this is

http://blog.qt.io/blog/2014/08/27/qt-weekly-18-static-linking-with-qt/



Regards

Kai


  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20151111/db29d244/attachment.html>


More information about the Qt-creator mailing list