4

I run Ubuntu 16.04 LTS. My problem is that I am not able to run a Qt5 app, which I can compile.

This is what I get when I try to run it:

/home/user/Desktop/sconfig/dist/Release/GNU-Linux/SCongif: /usr/lib/x86_64-linux-gnu/libQt5OpenGL.so.5: version `Qt_5' not found (required by /home/user/Desktop/sconfig/dist/Release/GNU-Linux/SCongif)
/home/user/Desktop/sconfig/dist/Release/GNU-Linux/SCongif: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5' not found (required by /home/user/Desktop/sconfig/dist/Release/GNU-Linux/SCongif)
/home/user/Desktop/sconfig/dist/Release/GNU-Linux/SCongif: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.6' not found (required by /home/user/Desktop/sconfig/dist/Release/GNU-Linux/SCongif)
/home/user/Desktop/sconfig/dist/Release/GNU-Linux/SCongif: /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5: version `Qt_5' not found (required by /home/user/Desktop/sconfig/dist/Release/GNU-Linux/SCongif)
/home/user/Desktop/sconfig/dist/Release/GNU-Linux/SCongif: /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5: version `Qt_5' not found (required by /home/user/Desktop/sconfig/dist/Release/GNU-Linux/SCongif)

I then removed Qt5 and purged all the remnants. Then I installed again Qt5.

user@user-P64V7:~$ which qmake
/home/user/Qt5.8.0/5.8/gcc_64/bin/qmake
user@user-P64V7:~$ qmake --version
QMake version 3.1
Using Qt version 5.8.0 in /home/user/Qt5.8.0/5.8/gcc_64/lib
user@user-P64V7:~$ echo $PATH
/home/user/Qt5.8.0/5.8/gcc_64/bin:/home/user/bin:/home/user/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

It could also be worth noting that I use Netbeans 8.2 and the QMake command is

/home/user/Qt5.8.0/5.8/gcc_64/bin/qmake

Any idea what I could be doing wrong?

Thanks a lot!

Leta
  • 331
  • 1
  • 4
  • 16
  • Did you read [this thread](http://stackoverflow.com/questions/40945442/qt5-linker-error-version-qt-5-not-found?rq=1)? – m7913d Apr 30 '17 at 18:42
  • Yes, I went through all of the threads I could find. My problem is not compilation, but execution... – Leta Apr 30 '17 at 20:38

2 Answers2

4

So I figured out an answer according to these two previous questions:

To summarize, to add the libraries the right way, one should add a custom .conf file to the folder /etc/ld.so.conf.d containing all the absolute paths to library folders and then run sudo ldconfig. :)

Andrea Araldo
  • 1,332
  • 14
  • 20
Leta
  • 331
  • 1
  • 4
  • 16
  • Adding stuff in user home directory to global /etc/ld.so.conf.d is a bit dubious or at least ugly (for some definition of ugly)... I suppose it's fine on a personal workstation, but I'd rather add it to user-specific LD_LIBRARY_PATH, which is under the control of the user without root access. – hyde May 02 '17 at 14:01
  • Still, +1 for providing answer to your own unanswered question after figuring it out, which I always find commendable. – hyde May 02 '17 at 14:03
  • 1
    Actually, this is what I found among the answers from the second question: _Since Ubuntu 9.04 Jaunty Jackalope, LD_LIBRARY_PATH cannot be set in $HOME/.profile, /etc/profile, nor /etc/environment files. You must use /etc/ld.so.conf.d/.conf configuration files._ – Leta May 02 '17 at 14:21
  • Oh, didn't know that. I generally set LD_LIBRARY_PATH in `~/.bashrc`, it works for the applications I need it for. – hyde May 02 '17 at 14:27
0

cpu: armv8 os: Linux kylin.5.desktop-generic upgrade from 5.6 to 5.9

Similar situations will appear after the program is released.

solution:

  1. copy /usr/local/Qt-5.9.2 to /usr/local/ in target pc.

  2. qtchooser -install qt5.9 /usr/local/Qt5.9.1/5.9.1/gcc_64/bin/qmake

  3. sudo bash -c "echo export QT_SELECT=qt5.9 >> /etc/profile"

  4. sudo ldconfig -v

Sasha Tsukanov
  • 1,025
  • 9
  • 20
gui
  • 1