简体   繁体   English

在 Ubuntu 上安装 Qt

[英]Install Qt on Ubuntu

Need to build simple GUI application.需要构建简单的 GUI 应用程序。 For this reason I decided to install Qt on my Ubuntu 16. I have downloaded open source Qt edition from theirs site .出于这个原因,我决定在我的 Ubuntu 16 上安装 Qt。我已经从他们的站点下载了开源 Qt 版本。 Got error while run:运行时出错:

g@ubuntu:~/Downloads$ ./qt-unified-linux-x86-2.0.5-2-online.run 
./qt-unified-linux-x86-2.0.5-2-online.run: error while loading shared libraries: libX11.so.6: cannot open shared object file: No such file or directory

How to fix that?如何解决?

Install Qt安装 Qt

sudo apt-get install build-essential

sudo apt-get install qtcreator

sudo apt-get install qt5-default

Install documentation and examples If Qt Creator is installed thanks to the Ubuntu Sofware Center or thanks to the synaptic package manager, documentation for Qt Creator is not installed.安装文档和示例 如果由于 Ubuntu 软件中心或突触包管理器安装了 Qt Creator,则不会安装 Qt Creator 的文档。 Hitting the F1 key will show you the following message : "No documentation available".按 F1 键将显示以下消息:“无可用文档”。 This can easily be solved by installing the Qt documentation:这可以通过安装 Qt 文档轻松解决:

sudo apt-get install qt5-doc

sudo apt-get install qt5-doc-html qtbase5-doc-html

sudo apt-get install qtbase5-examples

Restart Qt Creator to make the documentation available.重新启动 Qt Creator 以使文档可用。

Error while loading shared libraries加载共享库时出错

Problem:问题:

radiusd: error while loading shared libraries: libfreeradius-radius-2.1.10.so: cannot open shared object file: No such file or directory radiusd:加载共享库时出错:libfreeradius-radius-2.1.10.so:无法打开共享对象文件:没有这样的文件或目录

Reason:原因:

Actually, the libraries have been installed in a place where dynamic linker cannot find it.实际上,这些库已经安装在动态链接器找不到的地方。

Solution:解决方法:

While this is not a guarantee but using the following command may help you solve the “cannot open shared object file” error:虽然这不是保证,但使用以下命令可以帮助您解决“无法打开共享对象文件”错误:

sudo /sbin/ldconfig -v

http://www.lucidarme.me/how-install-documentation-for-qt-creator/ http://www.lucidarme.me/how-install-documentation-for-qt-creator/

https://ubuntuforums.org/showthread.php?t=2199929 https://ubuntuforums.org/showthread.php?t=2199929

https://itsfoss.com/error-while-loading-shared-libraries/ https://itsfoss.com/error-while-loading-shared-libraries/

ModelSim-Altera error ModelSim-Altera 错误

ubuntu 包名称是qt5-default ,而不是qt

In Ubuntu 18.04 the QtCreator examples and API docs missing, This is my way to solve this problem, should apply to almost every Ubuntu release.在 Ubuntu 18.04 中缺少 QtCreator 示例和 API 文档,这是我解决此问题的方法,几乎​​适用于每个 Ubuntu 版本。

For QtCreator and Examples and API Docs:对于 QtCreator 和示例以及 API 文档:

sudo apt install `apt-cache search 5-examples | grep qt | grep example | awk '{print $1 }' | xargs `

sudo apt install `apt-cache search 5-doc | grep "Qt 5 " | awk '{print $1}' | xargs`

sudo apt-get install build-essential qtcreator qt5-default

If something is also missing, then:如果还缺少某些东西,则:

sudo apt install `apt-cache search qt | grep 5- | grep ^qt | awk '{print $1}' | xargs `

Hope to be helpful.希望有所帮助。

Also posted in Ask Ubuntu: https://askubuntu.com/questions/450983/ubuntu-14-04-qtcreator-qt5-examples-missing也发布在 Ask Ubuntu: https : //askubuntu.com/questions/450983/ubuntu-14-04-qtcreator-qt5-examples-missing

还可以看看很棒的项目aqtinstall https://github.com/miurahr/aqtinstall/ (它可以在 Linux、Mac 和 Windows 机器上安装任何 Qt 版本,无需任何交互!)和使用此工具的 GitHub Action: https:/ /github.com/jurplel/install-qt-action

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM