系統環境
- macOS Ventura 13.0.1
安裝虛擬機
安裝 Ubuntu 作業系統
在虛擬機中安裝 Ubuntu
在 VMWare Workstation 上安裝 Ubuntu Linux 的逐步指南
配置開發環境
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 無法正常使用中文輸入。


