win10家庭版+ubuntu20.04虚拟机+Qt5.9.0开发环境搭建

1. win10家庭版创建ubuntu20.04虚拟机

win10家庭版创建ubuntu20.04虚拟机,无法使用低于16.1.2的版本,因为win10家庭版与低版本VMware专业版不兼容,启动虚拟机时win10家庭版直接蓝屏重启。
官网下载 VMware-workstation-full-16.1.2-17966106.exe,激活码随便找
官网下载 ubuntu-20.04.2.0-desktop-amd64.iso

2. 安装qt5.9.0

官网下载 qt-opensource-linux-x64-5.9.0.run
修改权限:sudo chmod +x qt-opensource-linux-x64-5.9.0.run
安装:sudo ./qt-opensource-linux-x64-5.9.0.run
安装后,新建项目编译时报错“Could not determine which ”make“ command to run. Check the ”make“ step in the build configuration.”
需要手动安装编译器。

3. 修改使用清华源

官网下载的镜像安装编译器总是提示各种问题,如下:


Reading package lists… Done
Building dependency tree
Reading state information… Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
build-essential : Depends: libc6-dev but it is not going to be installed or
libc-dev
Depends: gcc (>= 4:4.4.3) but it is not going to be installed
Depends: g++ (>= 4:4.4.3) but it is not going to be installed
E: Broken packages


3.1修改/etc/apt/sources.list,将原内容替换为以下内容(来自https://blog.csdn.net/qq_43158436/article/details/108990925)

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse

3.2 sudo apt update
3.3 sudo apt upgrade

4. 安装编译环境

sudo apt-get install build-essential

5. Qt项目编译

报错 error: cannot find -lGL
执行 sudo apt-get install libgl1-mesa-dev

6. 大功告成

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

WHUTztb

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值