Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Deploying on linux, executable cannot find shared library at runtime?
Forum Updated to NodeBB v4.3 + New Features

Deploying on linux, executable cannot find shared library at runtime?

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 4 Posters 1.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AaronKelsey
    wrote on last edited by AaronKelsey
    #1

    I have developed an application that works on Windows and I am working on getting it working on Linux. I have been able to link the libraries during compilation but I am unable to get them to work at runtime.

    I have looked everyone on the internet and I have implemented what I believe is the correct approach but unfortunately it does not seem to work no matter what I try.

    when running ldd on the binary It shows that it cannot find the libraries despite changing the location for which it should be looking.

    linux-vdso.so.1 => (0x00007fff757f5000)
    libopensslwrap.so.1 => not found
    libQt5Widgets.so.5 => /usr/lib64/libQt5Widgets.so.5 (0x00000038b8e00000)
    libQt5Network.so.5 => /usr/lib64/libQt5Network.so.5 (0x00000038b4e00000)
    libQt5Xml.so.5 => /usr/lib64/libQt5Xml.so.5 (0x00007f76a89ee000)
    libQt5Gui.so.5 => /usr/lib64/libQt5Gui.so.5 (0x00000038b7600000)
    libQt5Core.so.5 => /usr/lib64/libQt5Core.so.5 (0x00000038b6e00000)
    libicudata.so.52 => not found
    libicui18n.so.52 => not found
    libicuio.so.52 => not found
    libicule.so.52 => not found
    libiculx.so.52 => not found
    libicutest.so.52 => not found
    libicutu.so.52 => not found
    libicuuc.so.52 => not found
    libcrypto-1_0_2.so.1.0.2 => not found
    libssl-1_0_2.so.1.0.2 => not found
    libGL.so.1 => /usr/lib64/libGL.so.1 (0x00000038c0200000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x00000038b2a00000)
    libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00000038bd200000)

    I have implemented this in my project file but unfortunately It does not do anything.

    path/to/project/bin <- where the binary is.
    path/to/project/lib <- where the library files are.

    linux {
    QMAKE_LFLAGS_RPATH =
    QMAKE_LFLAGS += '-Wl,-rpath,\'\$$ORIGIN/../lib\''
    }

    Can anyone work out what I have done wrong?

    jsulmJ 1 Reply Last reply
    0
    • A AaronKelsey

      I have developed an application that works on Windows and I am working on getting it working on Linux. I have been able to link the libraries during compilation but I am unable to get them to work at runtime.

      I have looked everyone on the internet and I have implemented what I believe is the correct approach but unfortunately it does not seem to work no matter what I try.

      when running ldd on the binary It shows that it cannot find the libraries despite changing the location for which it should be looking.

      linux-vdso.so.1 => (0x00007fff757f5000)
      libopensslwrap.so.1 => not found
      libQt5Widgets.so.5 => /usr/lib64/libQt5Widgets.so.5 (0x00000038b8e00000)
      libQt5Network.so.5 => /usr/lib64/libQt5Network.so.5 (0x00000038b4e00000)
      libQt5Xml.so.5 => /usr/lib64/libQt5Xml.so.5 (0x00007f76a89ee000)
      libQt5Gui.so.5 => /usr/lib64/libQt5Gui.so.5 (0x00000038b7600000)
      libQt5Core.so.5 => /usr/lib64/libQt5Core.so.5 (0x00000038b6e00000)
      libicudata.so.52 => not found
      libicui18n.so.52 => not found
      libicuio.so.52 => not found
      libicule.so.52 => not found
      libiculx.so.52 => not found
      libicutest.so.52 => not found
      libicutu.so.52 => not found
      libicuuc.so.52 => not found
      libcrypto-1_0_2.so.1.0.2 => not found
      libssl-1_0_2.so.1.0.2 => not found
      libGL.so.1 => /usr/lib64/libGL.so.1 (0x00000038c0200000)
      libpthread.so.0 => /lib64/libpthread.so.0 (0x00000038b2a00000)
      libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00000038bd200000)

      I have implemented this in my project file but unfortunately It does not do anything.

      path/to/project/bin <- where the binary is.
      path/to/project/lib <- where the library files are.

      linux {
      QMAKE_LFLAGS_RPATH =
      QMAKE_LFLAGS += '-Wl,-rpath,\'\$$ORIGIN/../lib\''
      }

      Can anyone work out what I have done wrong?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @AaronKelsey Take a look at https://doc.qt.io/Qt-5/linux-deployment.html

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        You can use a qt.conf file to say where the libraries are.

        For testing purpose, another way is to set the LD_LIBRARY_PATH environment variable to the path where the .libraries can be found.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        1
        • GianlucaG Offline
          GianlucaG Offline
          Gianluca
          wrote on last edited by
          #4

          Did you tried to use QMAKE_RPATHDIR that doesn't need to explicitly set compiler flags ??
          https://doc.qt.io/qt-5/qmake-variable-reference.html#qmake-rpathdir

          Also, did you try to run "readelf -d <binary>" to see if the RPATH has been correctly configured into the application binary ??

          1 Reply Last reply
          1

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved