What happens when you type gcc main.c?

Yoyman Manuel Castellar Miranda
1 min readFeb 5, 2020

--

GCC is a compiler integrated for C and C++ and others programming languages, generate a binary executable program in the language of the machine where it is to run.

The acronym GCC stands for “GNU Compiler Collection”. and the Syntax is:

gcc [ option| file] …

Examples:

gcc hello.c: Compile the program in C hello.c, generate an executable file a.out.

gcc -o hello hello.c: compile the program in C hello.c, generate an executable file hello.

gcc -c hello.c:
it does not generate the executable, but the object code, in the file hello.o. If it does not indicate a name for the object file, use the name of the file in C and change the extension to .o.

gcc -c -o object.o hello.c:
generates the object code indicating the file name.

For more additional information use man gcc in Linux terminal.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

No responses yet

Write a response