Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Uic can't find shared library

    General and Desktop
    3
    6
    5655
    Loading More Posts
    • 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.
    • S
      stiopa last edited by

      I am trying to make a Qt5 part of my source tree, so I haven't installed it on my machine, just copied it from source control. I am having a problem when I try to run uic.exe:

      stiopa@stiopa-VirtualBox:~/ct/LinuxLibs/Qt/bin > ./uic
      ./uic: error while loading shared libraries: libQt5Core.so.5: cannot open shared object file: No such file or directory

      I am still getting the same error even when I copy the libQt5Core library to bin directory. How is uic looking for shared libraries? Is there any environment variable I need to set to fix it?

      1 Reply Last reply Reply Quote 0
      • J
        jafarabadi.qt last edited by

        Hi stiopa
        Do you want to have a stand-alone executable file?
        if it's true...
        i think that just with Qt Enterprise you can get it
        in other case
        you should keep library files in executable file path.

        1 Reply Last reply Reply Quote 0
        • S
          stiopa last edited by

          hi a.jafarabadi,
          I'm not sure if I understand what you mean by stand-alone executable?

          I've got ~/ct/LinuxLibs/Qt/lib in my PATH variable, but this doesn't seem to help. I was wondering if the path to lib file isn't stored in some config file and since I have copied the qt install now points to an incorrect directory?

          1 Reply Last reply Reply Quote 0
          • J
            jafarabadi.qt last edited by

            stand-alone mean that you have a single excusable file for app without libs.
            i am trying for it's solution ;)

            1 Reply Last reply Reply Quote 0
            • hskoglund
              hskoglund last edited by

              Hi, uic (and the other Qt executable files in the bin directory) are built to look for Qt DLLs like libQt5Core.so.5 in ./../lib, so if uic is in ~/ct/LinuxLibs/Qt/bin and libQt5Core.so.5 is in ~/ct/LinuxLibs/Qt/lib it should work fine.

              One possibility is that when you copied the DLLs you lost the symlinks, because if you look for the DLLs that uic wants:
              ldd uic
              you'll see that it wants libQt5Core.so.5, but the DLL in the lib directory is really called libQt5Core.so.5.3.1. When you install Qt it will make a symbolic link file in the lib directory "libQtCore.so.5 -> libQt5Core.so.5.3.1", perhaps it became a roadkill when you copied Qt?

              Another solution is to use Windows type of installing by placing the DLLs together with the exe files, but that won't work without rewiring the uic exe file using the chrpath command, so that it looks for Qt DLLs in the same directory as itself. I've more about chrpath "here ":http://www.tripleboot.org/?p=138#Linux

              1 Reply Last reply Reply Quote 0
              • S
                stiopa last edited by

                Thanks for the replies.
                export LD_LIBRARY_PATH=~/ct/LinuxLibs/Qt/lib fixed it.

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post