error while loading shared libraries: cannot open shared object file: No such file or directory

  • Hi everyone !
    When I ran the apps on the arm board, I got this error:
    error while loading shared libraries: cannot open shared object file: No such file or directory
    However, When I cross-compiled qt5.6, I have added the option -opengl es2. Why does this error still occur ? Could anyone help me ? Thanks in advance !

  • Moderators

    You've added the library for linking, which has gone well and you have your executable. Now you need to make sure the library is found at load-time (i.e. when the application is started). It's a long discussion why, but sufficed to say, you need to follow the deployment for the platform (assuming Linux).

    Kind regards.

  • Have you used the ldd-command to check, whether the can be found on your target device for your executable ( If it cannot be found but is on your target-system, you should take a closer look into your path-variables (had that trouble on my RPi once).

    You could also try to add the path of the dynamic library to the LD_LIBRARY_PATH-Variable. I had some troubles with it myself some years ago when I cross-compiled Qt.

  • @raspe88 @kshegunov Thanks for your reply. However, I'd like to know that whether the on the pc host is suitable for the arm board. If not, where could get the libGLESV2 for the special arm board ? In my mind, the libGLES2v2 should be generated after compiling qt5.6 source code.

  • Lifetime Qt Champion

    @small_bird No you cannot use a lib from your x86 PC on an ARM board. How should this work? ARM processor has no clue about x86 machine code.
    And no, Qt is not responsible for compiling libGLES2v2 (as it is not part of Qt). You have to ensure you have that library on your target. How to do so depends on the Linux distribution you're running on your target.

  • @jsulm Yes, I know what you mean. Actually, I'd like to use the QML feature. According to Qt5.6 document, qml is based on opengl es2. So, I have to transplant opengl es2 to arm board. Am I right? If not, how to use QML feature on arm board?

  • Lifetime Qt Champion

    @small_bird You need to install opengl es2 on your board. How to do depends on the Linux distribution.
    It looks like you're able to cross compile Qt and your application. That means you should already have that library for ARM on your PC (in your sysroot?). Find it and copy to your board. Make sure it is really for ARM (call: file and check its output). Put the library in the same directory where your application executable is located and try to start the app.

  • @jsulm Yes, I have checked that ,my is for Intel 80386. But how to get that for arm?

  • @small_bird My linux core editon is linux3.2. The distrubution is the one made by myself, including linux image, boot file and file system.

  • Lifetime Qt Champion

    @small_bird If I understood you correctly you build Qt and QML by yourself for your target, right? Then you should have that library for your target on your PC.
    If you don't have it then you will need to compile it.

  • @jsulm OK, thanks a lot. I will download the opengl es2 source code and try to compile it.

  • @small_bird One thing that sometimes is more efficient than crosscompiling all stuff you need by yourself could be installing it on your target-device (if there exists some default package for that distribution) and than mounting that remote device using sshfs into your development device. You just need to change some environment variables within qtcreator so it will search there for the libraries instead of searching your development device. This little trick can speed up things very much.

    If your remote device should be too slow to mount it efficiently using sshfs, there's also the possibility of creating a diskdump of it using dd and mounting the image within your development device.

  • @raspe88 Thanks a lot !
    The reason may be that the is not the editon for my arm board. I will have a try.

Log in to reply