首先要安装一些环境想了解的更仔细:歪猴:gcc/g++ 、Make/Makefile、CMake/CMakeLists.txt、qmake关系简述 另外qt6中仍然可以使用qmake可以根据项目需要自己选择 。
sudo apt-get update
sudo apt-get install gcc g++ # 两个编译器
sudo apt-get install build-essential # 编译c/c++所需要的软件包
sudo apt-get install libgl1-mesa-dev # 安装mesa,Mesa 实际上是一个库,它实现了多种图形 API 规范
sudo apt-get install cmake # cmake的作用:CMakeLists.txt --> makefile
-
然后下载qt安装器在线安装器下载地址:Index of /archive/online_installers/4.0
-
可以查看这篇文章
快速搭建 Qt6 开发环境_qt6安装组件选哪几个-CSDN博客
安装完毕后打开qtcreator出现了
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
Aborted (core dumped)
这种提示。论坛里的原因是说是应该libxcb.so库链接不正确,也就是当加载libxcb.so库时,还需要加载libxcb-xinerama库,
sudo apt-get install libxcb-xinerama0
但问题仍然没解决。于是直接重装,这次没有安装qtcreator,而是安装完毕后采用命令行的形式安装
sudo apt-get install qtcreator 从官方仓库直接安装
然后终端启动成功。
不过qtcreator无法使用qt6.4,在“工具-》选项-》Kits-》添加-》qt-》qt版本”手动添加qt6.