Unsolved Compile QT 5.8 to cross-compile Beaglebone
-
what 's the problem might be here when i start an application:
This application failed to start because it could not find or load the Qt platform plugin "xcb" in "". Reinstalling the application may fix this problem. Aborted
it came when i uploaded new libraries 5.8.0 to /usr/lib/new5dot8libs/
and entered commands:LD_LIBRARY_PATH=/usr/lib/new5dot8libs export LD_LIBRARY_PATH
-
@Andrey-Shmelew something is not right with your path variable. I notice that your command is overwriting (rather than adding to) any existing LD_LIBRARY_PATH variable; is this intentional? One of these methods is more conventional:
PATH=$PATH:/new/path PATH=/new/path:$PATH
Also, did you put this command in a startup script? I'm not sure the export will survive a system restart.
-
hi! i have absolutely the same trouble:
i reproduse it with absolutely minimal qml example
When i deploy qt 5.5 application on beaglebone device (arm linux gnueabihf) - then works perfectly
When i deploy qt 5.8 - the error appears:QQmlApplicationEngine failed to load component qrc:/main.qml:-1 File not found
// this somehow works but the window is blank
main.cpp:#include <QGuiApplication> #include <QQuickView> int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); QQuickView view; view.setSource(QUrl::fromLocalFile("main.qml")); view.show(); return app.exec(); }
-
@Andrey-Shmelew You're using a relative path:
view.setSource(QUrl::fromLocalFile("main.qml"));
Depending from where you start your app the file will not be found.
You should construct an absolute path at runtime using http://doc.qt.io/qt-5/qcoreapplication.html#applicationDirPath -
@jsulm
um, should i make something like this?QQuickView view; view.setSource(QUrl::fromLocalFile("C:/qtqml57/main.qml")); view.show();
the output is still
file:///C:/qtqml57/main.qml: File not found
-
Because that file is located on your Windows machine.
If you don't want to put it in a Qt resource, then do as @jsulm suggested: build the path at run time.
-
@Andrey-Shmelew Something like this:
QString path = QCoreApplication::applicationDirPath() + '/' + "main.qml"; QQuickView view; view.setSource(QUrl::fromLocalFile(path)); view.show();
-
@jsulm
thanks, but it don't works for mefile:///usr/main.qml: File not found
note that when i deploy with qt 5.5 kit it enables to deploy without any path stuff
so if i upload main.qml to beaglebone's /usr/ folder then i get :
QQuickView only supports loading of root objects that derive from QQuickItem. If your example is using QML 2, (such as qmlscene) and the .qml file you loaded has 'import QtQuick 1.0' or 'import Qt 4.7', this error will occur. To load files with 'import QtQuick 1.0' or 'import Qt 4.7', use the QDeclarativeView class in the Qt Quick 1 module.
-
@Andrey-Shmelew "/usr"?!
Where is you app located? -
@jsulm
it is located in beaglebone's /usr folder when deployed.When i develop -main.qml is located on windows C:/qtqml57/main.qml ( qtqml57 is qt 5 project folder)
-
@Andrey-Shmelew Quite unusual location.
Can you describe how the layout of your app is?
Is it like this:/usr/YOUR_APP_EXECUTABLE /usr/main.qml
?
-
@jsulm
by default it is:project:
windows 10, project path C:/qtqml57/after rebuild it's deployed in Linux /usr/ directory
-
@Andrey-Shmelew can you please show how it looks like in /usr? Is it like I asked above? So, how does the deploy directory (/usr in your case) look like?
-
sorry for annoying
i just added to a .pro file as usual :
target.path = /usr INSTALLS += target DISTFILES +=
now on my beaglebone /usr/ folder looks like
-
@Andrey-Shmelew You should really upload a bigger picture - it is nearly impossible to see anything. I tried hard but could not find main.qml file there. So, where is it?
-
@Andrey-Shmelew And you should not pollute /usr with files of your app. It is better to use /opt/YOUR_APP_NAME.
-
-
@Andrey-Shmelew That's why it is not working
-
@jsulm
so if i upload main.qml to beaglebone's /usr/ folder then i get :QQuickView only supports loading of root objects that derive from QQuickItem.
If your example is using QML 2, (such as qmlscene) and the .qml file you
loaded has 'import QtQuick 1.0' or 'import Qt 4.7', this error will occur.To load files with 'import QtQuick 1.0' or 'import Qt 4.7', use the
QDeclarativeView class in the Qt Quick 1 module. -
@Andrey-Shmelew said in Compile QT 5.8 to cross-compile Beaglebone:
QDeclarativeView
It says what you should do: use QDeclarativeView instead of QQuickView