Unsolved Compile QT 5.8 to cross-compile Beaglebone
-
@jsulm said in Compile QT 5.8 to cross-compile Beaglebone:
And I guess you get this errors when you try to start your app on the target device, right?
absolutely!
Do the Qt libraries /usr/lib/arm-linux-gnueabihf/libQt5* have the same version number as the cross compiled Qt (5.8)?
No, they have 5.3.2 version number.
if i replace libQt5SerialPort.so.5 (version 5.3.2) by libQt5SerialPort.so.5 (version 5.8.0); i've got errors:
/usr/test/untitled2: /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5: no version information available (required by /usr/lib/arm-linux-gnueabihf/libQt5SerialPort.so.5) /usr/test/untitled2: /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5: no version information available (required by /usr/lib/arm-linux-gnueabihf/libQt5SerialPort.so.5) /usr/test/untitled2: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /usr/lib/arm-linux-gnueabihf/libQt5SerialPort.so.5)
-
@Andrey-Shmelew If you replace then replace all used libraries not just one of them!
And actually you should NOT replace system libraries as other applications could depend on them!
Instead deploy your app together with needed libraries as described in the link I posted before. -
thanks for the link.
probably i should paste all of needed libraries to separate folder (for example "/usr/lib/my5-8libs")
and then somehow to link my application to these libraries?
-
@Andrey-Shmelew You can put the libs into a separate folder, but you should use /usr/local/lib/... not /usr/lib
But then you either need to tell the system where to find them using LD_LIBRARY_PATH (described in the link I posted), or use RPATH to set the path to the libs in your executable, see https://en.wikipedia.org/wiki/Rpath
Using /usr/local/lib probably does not require LD_LIBRARY_PATH nor RPATH, but any other locations not searched by the OS by default do. -
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.