无法运行Qt应用:未找到版本“Qt_5”

时间:2017-04-30 14:52:29

标签: qt qt5 qmake

我运行Ubuntu 16.04 LTS。 我的问题是我无法运行Qt5应用程序,我可以编译。

这是我尝试运行它时得到的结果:

/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)

然后我删除了Qt5并清除了所有残余物。然后我又安装了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

值得注意的是,我使用的是Netbeans 8.2,而QMake命令是

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

知道我可能做错了吗?

非常感谢!

2 个答案:

答案 0 :(得分:3)

所以我根据前两个问题找到答案:

总而言之,要以正确的方式添加库,应该将自定义.conf文件添加到包含库文件夹的所有绝对路径的文件夹/etc/ld.so.conf.d,然后运行sudo ldconfig。 :)

答案 1 :(得分:0)

cpu:armv8 操作系统:Linux kylin.5.desktop-generic 从5.6升级到5.9

类似的情况将在程序发布后出现。

解决方案:

  1. /usr/local/Qt-5.9.2复制到目标计算机中的/usr/local/

  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