安装前准备1、判断gcc是否安装
sudo apt install gcc
2、判断g++是否安装
lu@lu-virtual-machine:~$ g++ -v Command 'g++' not found, but can be installed with: sudo apt install g++
按照提示安装如下:
lu@lu-virtual-machine:~$ sudo apt install g++ [sudo] password for lu: Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: g++-11 libstdc++-11-dev Suggested packages: g++-multilib g++-11-multilib gcc-11-doc libstdc++-11-doc The following NEW packages will be installed: g++ g++-11 libstdc++-11-dev 0 upgraded, 3 newly installed, 0 to remove and 76 not upgraded. Need to get 13.5 MB of archives. After this operation, 48.8 MB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://cn.archive.ubuntu.com/ubuntu jammy-updates/main amd64 libstdc++-11-dev amd64 11.4.0-1ubuntu1~22.04 [2,101 kB] Get:2 http://cn.archive.ubuntu.com/ubuntu jammy-updates/main amd64 g++-11 amd64 11.4.0-1ubuntu1~22.04 [11.4 MB] Get:3 http://cn.archive.ubuntu.com/ubuntu jammy/main amd64 g++ amd64 4:11.2.0-1ubuntu1 [1,412 B] Fetched 13.5 MB in 6s (2,209 kB/s) Selecting previously unselected package libstdc++-11-dev:amd64. (Reading database ... 185262 files and directories currently installed.) Preparing to unpack .../libstdc++-11-dev_11.4.0-1ubuntu1~22.04_amd64.deb ... Unpacking libstdc++-11-dev:amd64 (11.4.0-1ubuntu1~22.04) ... Selecting previously unselected package g++-11. Preparing to unpack .../g++-11_11.4.0-1ubuntu1~22.04_amd64.deb ... Unpacking g++-11 (11.4.0-1ubuntu1~22.04) ... Selecting previously unselected package g++. Preparing to unpack .../g++_4%3a11.2.0-1ubuntu1_amd64.deb ... Unpacking g++ (4:11.2.0-1ubuntu1) ... Setting up libstdc++-11-dev:amd64 (11.4.0-1ubuntu1~22.04) ... Setting up g++-11 (11.4.0-1ubuntu1~22.04) ... Setting up g++ (4:11.2.0-1ubuntu1) ... update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode Processing triggers for man-db (2.10.2-1) ... lu@lu-virtual-machine:~$
3、安装clang编译器
lu@lu-virtual-machine:~$ clang -v Command 'clang' not found, but can be installed with: sudo apt install clang
按照提示安装如下:
sudo apt install clang
安装结束后验证如下:
lu@lu-virtual-machine:~$ clang -v Ubuntu clang version 14.0.0-1ubuntu1.1 Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/11 Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/11 Candidate multilib: .;@m64 Selected multilib: .;@m64
4、安装make
lu@lu-virtual-machine:~$ make -v Command 'make' not found, but can be installed with: sudo apt install make # version 4.3-4.1build1, or sudo apt install make-guile # version 4.3-4.1build1
按照提示安装:
sudo apt install make lu@lu-virtual-machine:~$ sudo apt install make Reading package lists... Done Building dependency tree... Done Reading state information... Done Suggested packages: make-doc The following NEW packages will be installed: make 0 upgraded, 1 newly installed, 0 to remove and 75 not upgraded. Need to get 180 kB of archives. After this operation, 426 kB of additional disk space will be used. Get:1 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy/main amd64 make amd64 4.3-4.1build1 [180 kB] Fetched 180 kB in 1s (218 kB/s) Selecting previously unselected package make. (Reading database ... 190541 files and directories currently installed.) Preparing to unpack .../make_4.3-4.1build1_amd64.deb ... Unpacking make (4.3-4.1build1) ... Setting up make (4.3-4.1build1) ... Processing triggers for man-db (2.10.2-1) ... lu@lu-virtual-machine:~$ make -v GNU Make 4.3 Built for x86_64-pc-linux-gnu Copyright (C) 1988-2020 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. lu@lu-virtual-machine:~$ sudo apt install make-guile Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: guile-3.0-libs Suggested packages: make-doc The following packages will be REMOVED: make The following NEW packages will be installed: guile-3.0-libs make-guile 0 upgraded, 2 newly installed, 1 to remove and 75 not upgraded. Need to get 7,719 kB of archives. After this operation, 53.3 MB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy/universe amd64 guile-3.0-libs amd64 3.0.7-1 [7,538 kB] Get:2 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy/universe amd64 make-guile amd64 4.3-4.1build1 [182 kB] Fetched 7,719 kB in 2s (4,997 kB/s) (Reading database ... 190559 files and directories currently installed.) Removing make (4.3-4.1build1) ... Selecting previously unselected package guile-3.0-libs:amd64. (Reading database ... 190541 files and directories currently installed.) Preparing to unpack .../guile-3.0-libs_3.0.7-1_amd64.deb ... Unpacking guile-3.0-libs:amd64 (3.0.7-1) ... Selecting previously unselected package make-guile. Preparing to unpack .../make-guile_4.3-4.1build1_amd64.deb ... Unpacking make-guile (4.3-4.1build1) ... Setting up guile-3.0-libs:amd64 (3.0.7-1) ... Setting up make-guile (4.3-4.1build1) ... Processing triggers for man-db (2.10.2-1) ... Processing triggers for libc-bin (2.35-0ubuntu3.6) ...
5、安装最新版cmake
sudo snap install cmake --classic
要等待一会儿。。。
QT5安装 1、安装Qt5的组件sudo apt-get install build-essential2、安装Qt的开发工具
sudo apt-get install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools3、安装qtcreator
sudo apt-get install qtcreator4、安装qt
sudo apt-get install qt5*安装完毕
创建一个测试工程:
添加QLabler,运行结果如下:
到此,所有安装完成。