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. Error while loading shared libraries created by myself.
Forum Updated to NodeBB v4.3 + New Features

Error while loading shared libraries created by myself.

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 3 Posters 3.5k 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.
  • dennileD Offline
    dennileD Offline
    dennile
    wrote on last edited by A Former User
    #1

    I create a shared library and successfully build in QT GUI. I want to run the excutable file in the terminal, but I get the error:

    error while loading shared libraries: libtracker.so.1: cannot open shared object file: No such file or directory
    

    I can run normally in the QT GUI, but can not run in the terminal, and get the above error. So what should be the reason for that? Something is wrong when I create the lib?
    My operation system is :ubuntu 14.04
    QT:5.7.0

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #2

      hi
      everything is ok i think
      It just cannot find libtracker.so.1
      so is this your lib ?
      and if you do "locate libtracker.so.1"
      where is it then ?

      Also try ldd on your exe and see

      Its important to understand that your exe NEEDS the Qt so files
      to run
      http://www.tripleboot.org/?p=138
      Look in linux section.
      "Linux GCC 32-bit and 64-bit compilers:"

      dennileD 1 Reply Last reply
      2
      • mrjjM mrjj

        hi
        everything is ok i think
        It just cannot find libtracker.so.1
        so is this your lib ?
        and if you do "locate libtracker.so.1"
        where is it then ?

        Also try ldd on your exe and see

        Its important to understand that your exe NEEDS the Qt so files
        to run
        http://www.tripleboot.org/?p=138
        Look in linux section.
        "Linux GCC 32-bit and 64-bit compilers:"

        dennileD Offline
        dennileD Offline
        dennile
        wrote on last edited by dennile
        #3

        @mrjj thanks for your reply, I just find the method, I need to set the environment variable, LD_LIBRARY_PATH. After setting that, I can run it on terminal. Thanks anyway!
        -shan

        mrjjM 1 Reply Last reply
        1
        • dennileD dennile

          @mrjj thanks for your reply, I just find the method, I need to set the environment variable, LD_LIBRARY_PATH. After setting that, I can run it on terminal. Thanks anyway!
          -shan

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @dennile
          Ok. super. Well you need such folder if u plan to give programs to others.
          And yes LD_LIBRARY_PATH and rpath is how one can do it.

          1 Reply Last reply
          1
          • _ Offline
            _ Offline
            _hunter
            wrote on last edited by
            #5

            @dennile said in Error while loading shared libraries created by myself.:

            LD_LIBRARY_PATH

            hi,i meet the same problem as you,can you detail how you solve this problem?

            mrjjM 1 Reply Last reply
            0
            • _ _hunter

              @dennile said in Error while loading shared libraries created by myself.:

              LD_LIBRARY_PATH

              hi,i meet the same problem as you,can you detail how you solve this problem?

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @_hunter

              Hi
              bascially, you include the needed SO files etc and do

              #!/bin/bash
              cd /mnt/xx/theprogfolder
              export LD_LIBRARY_PATH=./
              ./progname 
              

              its shown in
              http://doc.qt.io/qt-5/linux-deployment.html
              section Creating the Application Package

              This is best used for testing. the rpath way is better for real deployment.
              or so i have been told.

              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