系统环境
- macOS Ventura 13.0.1
安装虚拟机
安装 Ubuntu 操作系统
在虚拟机中安装 Ubuntu
Step-By-Step Procedure To Install Ubuntu Linux On VMWare Workstation
配置开发环境
sudo apt update && apt full-upgrade -y # 更新系统
sudo apt install build-essential -y # 安装编译工具
sudo apt install vim -y # 安装 vim 编辑器
简单测试
gcc --version
# 输出
gcc (Ubuntu 12.2.0-3ubuntu1) 12.2.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
vim hello.c
#include<stdio.h>
int main(void){
printf("hello word! \n");
return 0;
}
# 按 ESC 输入 :wq 退出并保存文件
gcc -Wall hello.c -o hello
./hello
# 输出
hello word!
VS Code
sudo dpkg -i code*
注意:Snap 版本的 VS Code 无法正常输入中文。


