Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Ldd outputs statically linked on target pc even when my app was built with shared libraries
Forum Updated to NodeBB v4.3 + New Features

Ldd outputs statically linked on target pc even when my app was built with shared libraries

Scheduled Pinned Locked Moved Installation and Deployment
5 Posts 3 Posters 2.1k 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.
  • D Offline
    D Offline
    daanAr
    wrote on last edited by
    #1

    I want to deploy a simple app I created on a linux machine to another linux machine.

    I have two pc's, both running Ubuntu 12.04. On the development machine I created a simple app using Qt Creator and it runs fine. When I run the ldd command on this machine it outputs a whole bunch of libraries needed. Then I copied the app and the required libraries to the target machine and tried to run the app following the directions for deployment provided here: http://doc.qt.io/qt-5/linux-deployment.html
    but I get a segmentation fault error. When I run the ldd command again on the target machine it outputs: statically linked.

    I have same version of Qt on both machines Qt 5.3

    I am new to Qt and I don't know what I'm doing wrong, please help.

    1 Reply Last reply
    0
    • hskoglundH Offline
      hskoglundH Offline
      hskoglund
      wrote on last edited by
      #2

      Hi, the ldd command doesn't give you a 100% list of all DLLs/.so files, you should run "lsof -c YourAppName" in Terminal to see them all.

      Note that Ubuntu comes with a in built-in version of Qt which usually is older than the one you're using, this can create problems on non-development machines; it could be the reason for your segfaults. Also you can read more about deployment on Linux in my "blog":http://www.tripleboot.org/?p=138#Linux

      1 Reply Last reply
      0
      • D Offline
        D Offline
        daanAr
        wrote on last edited by
        #3

        Hello, I read and followed the instructions from your blog and added the instruction to my .pro file to set the rpath to the directory of my app. I also added the required .so libraries to the same directory. I tested the app on my development machine by running it from the deploy directory instead of QtCreator and it runs fine. Then I copied the same directory to the target machine and tried to run the app again. Same result as before, I get a seg fault error. Do you have any idea how to ensure it runs with the correct libraries? Wouldn't it be enough with the rpath setting?

        Also btw, the "lsof -c appName" command doesn't output anything on my machine.

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

          Hi and welcome to devnet,

          You should also set the LD_LIBRARY_PATH variable so it look first to a known directory containing your Qt build

          Hope it helps

          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
          0
          • D Offline
            D Offline
            daanAr
            wrote on last edited by
            #5

            Hi, I finally solved it! I finally got it running on my target machine. Apparently my app exe file got corrupted somehow when I copied it from one machine to the other. After that I was also missing some libraries that didn't show up with the "ldd" command. And also the platform path was missing.

            Thanks a lot for the help!

            1 Reply Last reply
            0

            • Login

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