Problem with executing cross-compiled QT application in beaglebone, libstdc++.so.6 correct version not found



  • hi everyone

    I have a problem when executing a simple hello world QT application on Beaglebone Black.

    My PC is running on Debian 8.7 jessie (64 bit), and here is how I cross compile the qt:

    First I downloaded the toolchain (both gcc-... and sysroot-...) from:
    https://releases.linaro.org/components/toolchain/binaries/latest/arm-linux-gnueabihf/

    then I download the qt5.8 version from:
    https://download.qt.io/official_releases/qt/5.8/5.8.0/single/

    then I change the qmake.conf located in qt-everywhere-opensource-src-5.8.0/qtbase/mkspecs/linux-arm-gnueabihf-g++/qmake.conf, like this:

    0_1496156694462_upload-ce3907b5-14e3-43e9-a31a-acf8f57e2ccd

    then I go the /qtbase and run the ./configure, as:

    qt-everywhere-opensource-src-5.8.0/qtbase/configure -platform linux-g++ -xplatform linux-arm-gnueabi-g++ -release -device linux-beagleboard-g++
    -sysroot /opt/arm-toolchain/sysroot-glibc-linaro-2.23-2017.05-arm-linux-gnueabihf/
    -prefix /opt/QtForBBB/
    -device-option CROSS_COMPILE=/opt/arm-toolchain/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-
    -qt-xcb
    -nomake tests -nomake examples -no-opengl

    then make && sudo make install

    so far everything works well even though there is some warning message during make, but at least I can compile qt application without problem.

    Then I upload the whole folder specific in the -prefix to beaglebone

    my beaglebone is running on Debian 7.11 wheezy

    then I did sudo apt-get install build-essential

    then I upload the cross-compiled binary to BBB, then the error shows:0_1496157030651_upload-ef2a93fd-e7dd-4191-962a-c2ea93a7c7e2

    then I locate my libstdc++.so.6 and check the version by doing:
    strings /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 | grep GLIBC, it shows
    0_1496157209095_upload-8c4585d6-ae03-442c-90a8-9418cd936f66

    so apparently there is no the required version as the error message indicated.

    then I do ldd TEST, it shows:
    0_1496157312365_upload-f3c700c8-6763-4bc4-893e-b8e884d9f616

    so can someone help me what should I do ? what am I missing?

    Thanks in advance!
    /pli


  • Moderators

    @pli_in_sweden Looks like your Linaro tool chain contains a newer libstdc++ than the one on your target device.
    What is running on your target device? Can you use a newer Linux version here?
    As alternative you could use an older Linaro tool chain.



  • This post is deleted!


  • @jsulm said in Problem with executing cross-compiled QT application in beaglebone, libstdc++.so.6 correct version not found:

    @pli_in_sweden Looks like your Linaro tool chain contains a newer libstdc++ than the one on your target device.
    What is running on your target device? Can you use a newer Linux version here?
    As alternative you could use an older Linaro tool chain.

    hi

    the device is running at debian wheezy 7, and I check the gcc version is lower than 4.6. Then I upgrade the version to 8.7 jessie and there is a gcc version of 4.9. Then I get a different error!
    0_1496329936349_upload-cfbf891f-4168-4ada-96f0-5e87406b9c20

    I wonder is it because the library problem? I found libQt5Widgets.so at three different location in my HOST pc:
    0_1496330159619_upload-e74c5899-7dc0-4ce7-87cd-7f355ed0d8b5

    I wonder which one is the correct one to use? I already uploaded the lib in the -prefix argument to BBB. But not the one in x86_64... and in the qtbase/.

    Then I upload all the libs, but still the problem is the same.

    Thanks for your help!

    /peilang


  • Lifetime Qt Champion

    Hi,

    The correct one should be the one for ARM.
    You can check that with the file command.



  • @SGaist

    hi ! and here is the result from LDD and file:
    0_1496412862316_upload-3f5e8bc6-03f7-48b4-bfeb-4c1dde2a4ce4

    From the ldd I see that the libQt5Widgets.so.5 is pointing to the one on the BBB, not the library that I copy from the HOST PC. It is because of these problem? How can I tell the compiled qt binary to link to the copied library?

    And also my Host pc is 64 bit debian, and the toolchain is also 64 bit, how come the compiled file is 32 bit?

    Thanks

    /Peilang



  • @pli_in_sweden I try to replace the libQt5Widgets.so.5.3.2 in the /usr/lib/arm-linux-gnueabihf/ with the one from my copied library. The result is that the corresponding error is gone. So I guess I need to find a way to let the binary file to link my copied library. And exporting the LD_LIBRARY_PATH doesn't work. It will shows the error that libstdc++6.so version not correct, just as the first image that I show.

    So the conclusion I guess the correct way is to use LD_LIBRARY_PATH and fix the libstdc++6 version. How can I do that?

    This is what I found for libstdc++.so.6 in my HOST pc:
    0_1496414725560_upload-a1aed8eb-4d01-4630-a2f8-6d78f771f57a

    And this is from BBB:
    0_1496414789786_upload-57796015-75f1-4204-9a51-5676a5ac0cdb

    how should I do then in order to link to the correct libstdc++?


  • Lifetime Qt Champion

    What is the exact error message ?



  • @SGaist hi
    the problem is solved. It is just that the libstdc++ on BBB has a different version from the one on my host pc. I simply copy the correct one to BBB and link to it.

    But now has another problem. It said it can not find platform plugin "eglfs" in "". And different from what I google, people who has this error has one more message of "The available platform is :......" . But my error doesn't list the available platform. Does it mean that I don't have any platform that can be used?

    I looked at the path/to/QT/plugins/platforms/, and there is no something related to eglfs, only libqlinuxfb.so

    when configuring the qt, I have the argument ./configure -qt-xcb.

    What should I ?

    Thanks


  • Lifetime Qt Champion

    Well, configure for eglfs then. Pass -qt-xcb means that you are building the xcb backend which requires an Xorg server running on your device.



  • @SGaist hi

    I first try 'sudo apt-get install libgles2-mesa-dev libgles2-mesa'.

    then I try to reconfigiure with after confclean:

    ...(the same as previous post).. -no-xcb -opengl es2 -eglfs

    But I get the error that said openGL test failed, and 'the eglfs was enabled´, but the pre-condition feature.egl failed'

    I realized that it could not find the libglesv2.so. But the thing is, I don't even have libglesv2.so in my sysroot/usr/lib!!

    I download the sysroot from https://releases.linaro.org/components/toolchain/binaries/latest/arm-linux-gnueabihf/

    How can I get a libglesv2.so?

    Or is there any other sysroot that I can use for QT5.8?

    Bests


  • Lifetime Qt Champion

    Usually the constructor of your device provides the necessary hooks in order to access the GPU on their hardware.



  • @SGaist hi

    Ok. So on BBB I found the libqeglfs.so in /usr/lib/arm-linux-guneabihf/qt5/plugins/platforms/. What exactly should I do then?

    I guess instead of using the sysroot from linaro website. I mount the / of BBB to my host PC and use that as a sysroot when doing the configuration.

    Let's say I mount the / to /mnt/bbb of my host

    sudo sshfs debian@192.168.7.2:/ /mnt/BBB

    Is it correct then to to modify the qmake.conf

    QMAKE_INCDIR_EGL = /mnt/BBB/usr/include
    QMAKE_LIBDIR_EGL = /mnt/BBB/usr/lib

    save qmake.conf.

    Then run configure as :

    ./configure -platform linux-g++ -xplatform linux-arm-gnueabi-g++ -release -device linux-beagleboard-g++ -sysroot /mnt/BBB -prefix /opt/Qt5.8-arm/ -device-option CROSS_COMPILE=/opt/pliARMtoolchain/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- -nomake tests -nomake examples -no-xcb -opengl es2 -eglfs

    then it gies en error:

    The OpenGL ES 2.0 functionality test failed!
    You might need to modify the include and library search paths by editing
    QMAKE_INCDIR_OPENGL_ES2, QMAKE_LIBDIR_OPENGL_ES2 and QMAKE_LIBS_OPENGL_ES2 in
    /home/pli/Downloads/qt-everywhere-opensource-src-5.7.0/qtbase/mkspecs/linux-g++.

    I can find the libGLESv2.so in /mnt/BBB/usr/lib/arm-linux-gnueabihf/. And I already 'sudo apt-get install libgles2-mesa-dev libgles2-mesa', so please guide me how I should find the OPEN GL es2 header and library, from sysroot or from the host?

    Thanks!


  • Lifetime Qt Champion

    You should use the verbose mode to get the exact error matching the functionality test for OpenGL ES 2.0.



  • @SGaist said in Problem with executing cross-compiled QT application in beaglebone, libstdc++.so.6 correct version not found:

    You should use the verbose mode to get the exact error matching the functionality test for OpenGL ES 2.0.

    hi

    here is the result
    0_1497101612728_upload-a164f612-33fe-4292-902b-4425203a5938

    I have been searching the headers, but on BBBI only found /usr/include/GL/gl.h, not gl2.h!

    THe BBB image is Debian 8.7 2017-03-19 4GB SD LXQT which is available on beaglebone.org.

    I have tried to use the SGX driver by following the instruction here http://elinux.org/BeagleBoardDebian#Debian_8_.28jessie.29 (SGX section)

    After that I have the libGLESv2.so, but I don't have the headers!

    Best
    /Peilang



  • @pli_in_sweden

    THe problem is solved by installing libgles-mesa-dev, then I got the folder of GLES2.

    ANd finally the ./configure work very well witout error.

    But then there is error when doing make:
    0_1497107477431_upload-e4eea728-8879-4e4e-bbb3-80b20dbc606d

    I used to use toolchain and sysroot from linaro website. And there is no make error.But that is because the sysroot from linaro doesn't support opengl es2, and that is why I mount the BBB as sysroot instead. And now the configuration with -opengl es2 work, but during make there seems to be some conflict.

    /Peilang


  • Lifetime Qt Champion

    Can you give more details about the conflicts ?



  • @SGaist hi

    I uploaded the pictures but seems it is not loaded.

    But anyway, the problem is caused by the toolchain that I used, which has a version of 6.3.1. While the BBB has a gcc version of 4.9. So I download the toolchain with gcc4.9 and I success the run make without error.

    However, when I try to run the application on the BBB and show it on a touch screen, there is the error:
    "
    EGL error: could not create the egl surface : error = 0x300b
    Aborted
    "

    But if I unset the LD_LIBRARY_PATH, the application can run, and show in the display. But then it wouldn't find the lib from QT.

    I guess it is needed to set LD_LIBRARY_PATH, and thus I need to fix the error above.

    Any clue?

    And thanks again for the guide, you are very helpful and save me a lot of time on blindly goolging.

    /Peilang


  • Lifetime Qt Champion

    The upload feature is currently broken. See here for a guide on how to share an image.

    IIRC, you have a Mali GPU on that device, did you check that you have the matching libraries installed ?



  • @SGaist said in Problem with executing cross-compiled QT application in beaglebone, libstdc++.so.6 correct version not found:

    Mali GPU

    hi

    Can you give more detail on how I can check the library for Mali? I don't know anything about Mali...

    Here is the output of ldd comamnd when LD_LIBRARY_PATH is EXPORTED (the app can NOT run because of the EGL error):

    Here is the output of ldd comamnd when LD_LIBRARY_PATH is UNSET (the app can run WITHOUT the EGL error):

    But what library am I looking at? Thanks.

    This is how it looks with the EGL error:

    (Is it because I have not fixed the first two warning yet?)

    I also have a second question, I found out that I need to put my source files (.cpp .h and .pro) inside the /qtbase/example on my host PC in order to build and run the app without the EGL error (of cause this is when LD_LIBRARY_PATH is unset). And also need to add:

    target.path = $$[QT_INSTALL_EXAMPLES]/mySource/
    INSTALLS += target

    in the .pro file.

    If I put my source file elsewhere outside the /qtbase/examples/, I can build, but the app will have the EGL error.

    The output from "qmake -query QT_INSTALL_EXAMPLES" is:
    /home/pli/BBB/home/debian/Qt5.8-arm/examples

    (/home/pli/BBB is where I mount the BBB via sshfs)

    I don't find the 'examples' folder under Qt5.8-arm.

    So I have no idea what is wrong here that I have to build the code inside the /qtbase/examples.

    Thanks.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.