这些小活动你都参加了吗?快来围观一下吧!>>
电子产品世界» 论坛首页» 活动中心» 板卡试用» 【换取手持数字示波器】Ubuntu中QT5的安装

共10条 1/1 1 跳转至

【换取手持数字示波器】Ubuntu中QT5的安装

菜鸟
2024-03-31 14:37:47 被打赏40分(兑奖) 打赏

安装前准备1、判断gcc是否安装

判断: gcc -v

image.png

没有安装的话记得安装:

安装如下:

sudo apt install gcc

2、判断g++是否安装

判断:g++ -v

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编译器

先判断 : clang -v

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  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-essential
2、安装Qt的开发工具
sudo apt-get install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools
3、安装qtcreator
sudo apt-get install qtcreator
4、安装qt
sudo apt-get install qt5*
安装完毕

image.png


创建一个测试工程:

image.png

添加QLabler,运行结果如下:

image.png

到此,所有安装完成。







关键词: QT安装

专家
2024-03-31 17:48:40 打赏
2楼

感谢分享


高工
2024-03-31 17:50:38 打赏
3楼

看看


院士
2024-03-31 19:52:01 打赏
4楼

看上去Qt的安装 还是非常方便的啊


专家
2024-04-01 00:20:40 打赏
5楼

感谢楼主分享


专家
2024-04-05 17:47:27 打赏
6楼

学习了,感谢楼主分享


工程师
2024-04-06 14:37:45 打赏
7楼

学习了


专家
2024-04-06 20:04:40 打赏
8楼

谢谢分享


工程师
2024-04-07 08:57:19 打赏
9楼

谢谢分享。学习了。


高工
2024-04-07 10:52:39 打赏
10楼

Qt现在开启了全面收费策略。

也不知道未来会是怎么样啊


共10条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册]