Compiling C programs with gcc

Опубликовано: 14 Май 2026
на канале: Chris Gregg
6,426
43

In cs107, we will primarily be using Makefiles to compile our code, but you should know how to use gcc (the GNU Compiler Collection) to compile a C program independently.

We will use three primary flags in cs107:

-g : embed debugging information into the program so gdb will give us good information.
-Og : compile with gdb in mind, so it leaves in variable information and doesn't optimize out too many variables.
-std=gnu99 : the flavor of C we will be using for cs107.