无法加载QT环境

时间:2020-09-01 16:14:21

标签: qt qt5 linux-mint

我完全不知所措,希望有人能提供帮助。我已经习惯了Visual Studio环境和设置,而QT对我来说却是新的。我正在运行Linux Mint(debian 20.04),并安装了qt5-default和qtcreator。 QT创建者第一次加载良好,没有问题,但是,在关闭应用程序并重新启动系统后,它拒绝加载。我一直在努力地研究Google和Stack,发现了一些类似的问题,但是到目前为止,没有找到适合我的解决方案。尝试从终端运行qtcreator会显示以下输出:

qtcreator: /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5: no version information available (required by qtcreator)
qtcreator: /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5: no version information available (required by qtcreator)
qtcreator: /usr/lib/x86_64-linux-gnu/libQt5Network.so.5: no version information available (required by qtcreator)
qtcreator: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: no version information available (required by qtcreator)
qtcreator: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: no version information available (required by qtcreator)
qtcreator: /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5: no version information available (required by /usr/bin/../lib/x86_64-linux-gnu/qtcreator/libExtensionSystem.so.4)
qtcreator: /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5: no version information available (required by /usr/bin/../lib/x86_64-linux-gnu/qtcreator/libExtensionSystem.so.4)
qtcreator: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: no version information available (required by /usr/bin/../lib/x86_64-linux-gnu/qtcreator/libExtensionSystem.so.4)
qtcreator: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: no version information available (required by /usr/bin/../lib/x86_64-linux-gnu/qtcreator/libExtensionSystem.so.4)
qtcreator: /usr/lib/x86_64-linux-gnu/libQt5Xml.so.5: no version information available (required by /usr/bin/../lib/x86_64-linux-gnu/qtcreator/libUtils.so.4)
qtcreator: /usr/lib/x86_64-linux-gnu/libQt5Network.so.5: no version information available (required by /usr/bin/../lib/x86_64-linux-gnu/qtcreator/libUtils.so.4)
qtcreator: /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5: no version information available (required by /usr/bin/../lib/x86_64-linux-gnu/qtcreator/libUtils.so.4)
qtcreator: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: no version information available (required by /usr/bin/../lib/x86_64-linux-gnu/qtcreator/libUtils.so.4)
qtcreator: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: no version information available (required by /usr/bin/../lib/x86_64-linux-gnu/qtcreator/libUtils.so.4)
qtcreator: /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5: no version information available (required by /usr/bin/../lib/x86_64-linux-gnu/qtcreator/libUtils.so.4)
qtcreator: /usr/lib/x86_64-linux-gnu/libQt5Network.so.5: no version information available (required by /usr/lib/x86_64-linux-gnu/libQt5Qml.so.5)
qtcreator: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: no version information available (required by /usr/lib/x86_64-linux-gnu/libQt5Qml.so.5)
qtcreator: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: no version information available (required by /usr/lib/x86_64-linux-gnu/libQt5Qml.so.5)
qtcreator: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: no version information available (required by /usr/lib/x86_64-linux-gnu/libQt5Qml.so.5)
qtcreator: symbol lookup error: /usr/lib/x86_64-linux-gnu/libQt5Qml.so.5: undefined symbol: _ZTI26QAbstractDynamicMetaObject, version Qt_5_PRIVATE_API`

qtchooser/default.conf contained
/usr/lib/x86_64-linux-gnu/qt5/bin
/usr/lib/x86_64-linux-gnu/qtcreator

从输出中看,似乎有两个相互矛盾的版本,但是,作为QT的新手,我不确定如何或将其指向正确的版本。感谢您的帮助!

1 个答案:

答案 0 :(得分:1)

我们应该有很多行,例如:

qtcreator: /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5: no version information available (required by qtcreator)

指向Linux文件系统user的根目录而不指向/home/user表示我们已经安装了sudo apt install qtcreator的Qt Creator(不是真正的最新Qt框架,甚至不是Creator),这可能可以作为较旧的IDE派上用场,但没有太多其他优点,并且由于许多库软链接重定向等原因而容易出现系统错误。

首先将其清除出系统:

sudo apt purge qtcreator

按照原始发布者的要求,通过使用Qt Maintenance Tool,完全删除了软件包安装的Qt Creator并安装了带有新Qt Creator选件的新Qt完整框架,从而解决了问题。在下载执行文件属性后,您可能要为其启用该功能:

chmod +x ~/Downloads/qt-unified-linux-x64-3.2.3-online.run
~/Downloads/qt-unified-linux-x64-3.2.3-online.run

P.S。请注意,以上内容为用户安装了Qt Creator和框架,但当然要使用sudo并指向正确的位置,我们可以以root用户身份为整个系统安装Qt,但不建议这样做:https://forum.qt.io/topic/31366/install-qt-qt-creator-as-root那么为什么呢? sudo apt install qtcreator仍然是广泛传播的选择吗?如果是这样,允许其他用户通过一些软链接练习访问您的文件。