How to work with GCC | Compilation process and GCC | Compilation and Linking

preview_player
Показать описание
Hey everyone!
In this video:
1. How to preprocess a source file in GCC?
2. How to convert the High-Level Source file into Assembly code?
3. How to compile Assembly Code to Object code?
4. How to link in GCC?
5. GCC command to accomplish all of the above stages?

GCC is a very good compiler, supports many languages such as C, C++, Fortran, and Ada.

To compile a source file that can have extensions like .c, .cpp, etc
you will have to type -c command for each source file, but if you want to compile multiple source files in one go then you should type the name of all the source files along with the extension.

To link the object files produced during the compilation process,
you will have to type the name of all the object files along with the extension (.o) and put -o command followed by the output executable name (.exe for example).

There are many commands in GCC that can't be learned in just one go,
you must have to practice every day.
Here are some commands that are discussed in this video:
1. -c for just compilation stage
2. -S for just assembly output stage
3. -E for just preprocessing stage
4. -o for redirecting the output to a file
Apart from this, there are some other compilers, preprocessors, assemblers, and linker switches such as optimization switches -O, -O1, O2, etc. Will will learn all of these switches and commands in subsequent videos of this series.

Link to the Playlist:

Link to "Downloading and Installing GCC":
Link to "Getting Started with Programming":
Link to "Working with CommandLine":
Link to "Best Code Editor: Sublime Text":

If you want to learn C++ then you should check out my C++ series:
If you want to make your own games using Unity Engine then you should check out my Unity Engine series:

If you want to support me then, please subscribe, like, and share
Рекомендации по теме
Комментарии
Автор

You are my professor. Don't need University study anymore. CS103 C programming, bullshit! Salute, my professor! YouTube University is better than Harvard.

smithwill
Автор

thank you, this video gave clear guidance to an initially daunting task

boiz
Автор

Thank you very much!
Im currently learning C in the university, but no one told us how to compile 😅

HelPfeffer
Автор

extremely useful
many thanks for sharing your knowledge

samdavepollard
Автор

Thank you ! It was really helpful explanation :)

Edlin
Автор

Very good video, but the audio is hissy

quadodedevelop
Автор

Hi! I use gcc on windows, and till date i directly compiled source.c files in the following way: gcc source.c -o file.exe is this wrong? are there any benefits to doing it the way you do it? please let me know!
Edit: I commented after watching like 80 % of the video, just saw the ending now LOL. Guess I wasn't doing anything wrong.

pineapppleflux