Skip to content

gcc

How GCC compiles C: the preprocessor, compiler, assembler and linker stages.

1 min read

Compiling C files

image1

Compilation is the translation of source code (the code we write) into object code (sequence of statements in machine language) by a compiler.

The compilation process has four different steps:

  • The preprocessing
  • The compiling
  • The assembling
  • The linking

The preprocessor

gcc -E main.c

The compiler

gcc -S main.c

The assembler

gcc -c main.c

The linker

gcc main.c
./a.out

or

gcc main.c -o my_program
./my_program

Related articles

1 min read

ngrok

Exposing a local server to the internet with ngrok tunnels for testing and demos.

  • Developer Tools
1 min read

NetBeans

Building NetBeans from source, cleaning the Recent Projects list and choosing the JDK it runs on.

  • Developer Tools
1 min read

vim

Vim and Neovim setup: vimtex with Zathura, Neo-tree, packer.nvim and vim-plug.

  • Developer Tools

Type to search the whole site.