I’m down with GCC, yeah you know me!

Akeem Seymens
2 min readJun 20, 2019

--

When there is a file in your directory and your just itching to run it, you can’t just run it like a bash file. No, you need to give it a little TLC with GCC. GCC, or GNU Compiler Collection, a compiler that includes front ends for C, C++, Objective-C, Fortran, Ada, Go, and D, as well as libraries for these languages. C is a compiler language and will not interpret the code directly, it gets converted by the compiler. When you have a file like main.c, you save it after completing then compile it through GCC.

Compile with — gcc main.c — at the command prompt or terminal. It goes through a world win of an adventure.

The process of how it goes from uncompiled to compiled.

First, main.c which is the source code goes through preprocessing and compiler then it comes it is converted to assembly code, main.s, basically ones and zeros. After it is passed through the assembler which converts it through the object code, becoming a main.o file. It is still not linked to any libraries. Unfortunately, c is very lazy and doesn’t believe in holding commands so it then gets linked to the libraries. Those are the libraries that are at the top of the c file i.e st.dio and other libraries. After all that it is converted to an a.out file at which you can run the file by running ./a.out and it becomes executable. So after all of that, you are able to run your c program. Isn’t it amazing?!

--

--