Important: Please read the Qt Code of Conduct -

Uic can't find shared library

  • 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: 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?

  • 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.

  • 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?

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

  • Hi, uic (and the other Qt executable files in the bin directory) are built to look for Qt DLLs like in ./../lib, so if uic is in ~/ct/LinuxLibs/Qt/bin and 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, but the DLL in the lib directory is really called When you install Qt it will make a symbolic link file in the lib directory " ->", 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 ":

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

Log in to reply