一.安装gcc
就一句话
sudo apt-get install gcc
二安装gdb
也就一句话
sudo apt-get install gdc
一般默认安装gcc的时候会自动安装gdb,如果出现
Reading state information... Done
gdb is already the newest version (8.1-0ubuntu3).
The following packages were automatically installed and are no longer required:
linux-headers-4.15.0-47 linux-headers-4.15.0-47-generic
linux-image-4.15.0-47-generic linux-modules-4.15.0-47-generic
linux-modules-extra-4.15.0-47-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 304 not upgraded.
不用慌,你已经安上了。
三.快乐coding与使用gcc
就一句话
gcc 文件名 -o 目标文件名