Loading [MathJax]/jax/output/HTML-CSS/jax.js
C Fundamentals

1. Installation

  • For local development, I’m using WSL2 Ubuntu LTS 20.04, so I need to install build-essential
sudo apt install build-essential
Shell
  • Also I want to use gdb to debug
sudo apt install gdb
Shell
  • Finally I will upload my local directory to the cloud UsingTencentCloud
scp -r ~/my_dir isaac@tx:~/my_dir
Shell

2. Compile and Run

  • To Compile the source code with my desired .out filename
gcc my_program.c -o my_program.out
Shell
  • To Compile the file that can be debugged by GDB
gcc -g my_prog.c -o my_prog.out
Shell

To debug with GDB

gdb my_prog.out
Shell

See below using WSL2 Ubuntu LTS 20.04 + Vim + Tmux


   Reprint policy


《C Fundamentals》 by Isaac Zhou is licensed under a Creative Commons Attribution 4.0 International License