Source

Table of Contents

What is GNU?

What is C?

Source

What is gcc?

$ man gcc

What happens when you type $ gcc main.c ?

Source use as a reference guide to follow along
main.c
$ vi main.c
#include <stdio.h>int main(void)
{
printf("Hello World!\n");
return (0);
}

Step 1: Preprocessing

$ gcc main.c
#include <stdio.h>/*** main - Entry point** Return: Always 0 (Success)*/
$ gcc -E main.c

Step 2: Compilation

$ gcc -S main.c
.asm code

Step 3: Assembly

compiled object code AKA machine code

Step 4: Linking

$ gcc main.c$ ls$ main.c a.out
$ gcc main.c -o output$ ls$ main.c ouput
$ ./output
$ ./a.out
$ ./a.out
Hello World!
$

I write and sell software ex: @auth0, @onelogin, @cisco, @stanfordGSE