Could you help me, please? I am wondering about something - we need a compiler in order to translate a source code in C to binary code understandable for a computer. However, how a compiler is written? I mean, is it in C which is, at this moment, not understandable for a computer yet? I get the "big idea" which you presented, and want to say - thank you for this. However, I still feel that something is missing for completely understanding. I have heard somewhere that some C compilers are written in C - but how is it possible? A huge please, could you explain it to me?
You might use what we call pre-compiled libraries in your code. These libraries are only available as object code (thus only as binary code, you have no access to the associated code lines). The preprocessor handles libraries for which the code is explicitly readable. So pre-compiled libraries are the kind that are handled by the linker.
Thank you for your awesome video sir. 1)What is the need of linker when compiler replaces all the header file source code in the main program code? i.e as according to my knowledge, at the first phase of compilation itself all the other files are included and the they are converted into object file. so, the other files(source code ) will be already linked and there is no need for linker. please clarify me..
+Ajithkumar Sekar In first step header file will be include which don't contain actual content of library. It contains only signature of function not their definition. Linker is actual component which will link function definition with function calling statement.
suppose there are multiple users coding program ,E.g. one is coding how to add and another one how to subtract and so on.Each one of them will have their own code and header files that runs separately. Linker link those files together to form 1 single code with all functionalities that those code were having into a single .exe(executable) file with all header files that are required.
+sanjeet kumar Compilation process actually contain these steps. Compiler is one of them. When we compile it doesn't directly convert into machine language. It does preprocessing, then conversion at last linking. So take it as Compilation process has different modules.
nice explanation.. have some doubts 1. can you please explain clearly what is use of assembler ? 2.In which stage memory allocation will happen for variables ?
In the beginning there were only machine code, later came assemble language in which word has been assigned to operation codes ( add, sub, mul). These codes known as mnemonic. Still people felt difficulties in coding, then came high level language. Now what their developer did, they just though that assembler( who convert from assemble to machine code) is already available and if we can convert our high level code into assembly we no more need to worry about conversion to machine code. So they used assembler in their compiler internally. Memory allocation is done at compile or run time both. When we declare variable, they take memory at compile time but malloc function used to allocate memory at run time.
So every library must contain the object file .o so that linker can link to those object file present in library. So say, if object file is not present in the library on which our program is dependent, then the linker cannot link those libraries with our code. We cannot simply ship cpp files as a library. Am i right?
So there should be .lib file as well as .obj . If so then can you please differentiate between what kind of code obj contains and what .lib contains and why there are 2 different things. Thanks for reply
+Mojo Jojo .lib file contains .obj plus code to map address like if dynamic library is used then in that library some mechanism is there which will load library into memory and include address into compiled file. I hope it makes your concept clear. In case any query feel free to ask.
Compiler directly generates machine code and assembly code is generated as an intermediate step. When we use compiler all we can see is object code. Assembly code is not saved on hard disk.
This is very clear explanation. Thank you very much for your effort!!
Exactly explained in a way it should be explained. Thanks buddy!
thanks
I like your way of explaining the c program compilation process, it is simple and easy. Thank you so much.
Thank you so much, very easy to grasp and comprehensive, the diagrams makes everything looks very clear.Thank you.
Very simple and clean explication
Thank you very much :)
Perfect and Concise explanation. Best 6 minutes ever!
Thank you for appreciating
Welcome to the channel
Well done MAN... hopefully I got what I was looking for...
That's some good explanation right there !! GOOD JOB (y)
thank you for your kind words
Good explanation and clear slides.
Thank you.
Straight to the point video.
thank you so much you save my time.
Thank you, sir. Very nicely explained.
Very concise and clear explanation... Thank you!
explained amazingly! thank you.
Great explanation, thank you!
Very well explained.. Thank-you
Thank you. Quite good video and explanation.
Best video about compilation stages...thank u
Clear explanation, thanks mate.
Thank you very much. You are a genius. 👍 👍🔝🔝
well explained. to point, just what needed
explained in a nice way !
Very well explained l. Thank you brother
the best and short explanation ever thankss
Thank you for your nice and clear explanation 👍 😊
Thank you for the clear explanation
thank you man very helpfull tutorial
Thanks for your perfect explaination ☺️
This video is excellent!
Looks like I am ready for my final. thanks man
Thanks for your precision
Straight to the point.
Well explained! Thanks so much sir..
thankyou so much...i'm so good at programming but no one cud explain me this clear idea about compilation
glad to know that it was something helpful to you for understanding compilation.
kia ap mujay programming sikhae gi please
Thank you for the video.
Could you help me, please? I am wondering about something - we need a compiler in order to translate a source code in C to binary code understandable for a computer. However, how a compiler is written? I mean, is it in C which is, at this moment, not understandable for a computer yet? I get the "big idea" which you presented, and want to say - thank you for this. However, I still feel that something is missing for completely understanding. I have heard somewhere that some C compilers are written in C - but how is it possible? A huge please, could you explain it to me?
You could write a compiler for C that is written in C and then compile that with an existing compiler
I have one question
What happened in linker stage if there is no libraries available?
Thank U Easy explanation easy draws thnks
This a very very clear explanation.
Thanks for sharing... Very useful :) n precise
ashwini mushigeri You are welcome
bullshit
Thank you!🍀
Poco a Poco good stuff we need to link up
you are the best man
Good but video is going slowly.
Make it crisp . everything is good.thank you very much sir
Thank you, good explanation.
Thanks
thanks! useful video
a perfect short n precise explanation of what happens during compilation in c. kudos to you...
thanks
Thanks a lot dude!
That was really good!
+Navneet Joshi Thanks Navneet
Welcome to channel.
the explanation is very good n also in depth.thank u very much
Thanks
these all the best terminologies to learn exactly in embedded domain
you’re blessed 👍🏼🔥
Is it the same compilation process with c++?
Thq sir u taught us in very deep
Good explanation!
Really nice one.
Thankyou, Sir !!!
+Rafsanjani Muhammod You are welcome to channel.
awesome explanation!!
Wow very good informationp
In linker , You said it will link the code if we use the library but that was already happened in preprocessor right ?
You might use what we call pre-compiled libraries in your code. These libraries are only available as object code (thus only as binary code, you have no access to the associated code lines). The preprocessor handles libraries for which the code is explicitly readable. So pre-compiled libraries are the kind that are handled by the linker.
Thank you for your awesome video sir.
1)What is the need of linker when compiler replaces all the header file source code in the main program code? i.e as according to my knowledge, at the first phase of compilation itself all the other files are included and the they are converted into object file. so, the other files(source code ) will be already linked and there is no need for linker.
please clarify me..
+Ajithkumar Sekar In first step header file will be include which don't contain actual content of library. It contains only signature of function not their definition.
Linker is actual component which will link function definition with function calling statement.
suppose there are multiple users coding program ,E.g. one is coding how to add and another one how to subtract and so on.Each one of them will have their own code and header files that runs separately.
Linker link those files together to form 1 single code with all functionalities that those code were having into a single .exe(executable) file with all header files that are required.
thank you too
Very well explained sir.
Thank you so much
Why before linker only preprocessor directive
Why here compiler is converting .c into assembly then binary...,, Cant we can convert .c into binary directly
Your voice sounds a lot like Kudvenkat who I studied for years.
Nice explanation ❤
U did good job but u can do great sir
you said compiler has different modules, why did you make compiler block in compilation process? 1.02
+sanjeet kumar Compilation process actually contain these steps. Compiler is one of them.
When we compile it doesn't directly convert into machine language. It does preprocessing, then conversion at last linking.
So take it as Compilation process has different modules.
+HowTo So compiler only takes preprocessor input and convert into assembly language?
+sanjeet kumar yes it will take pre processed input and then convert it into assembly language.
Appreciate it
nice explanation.. have some doubts
1. can you please explain clearly what is use of assembler ?
2.In which stage memory allocation will happen for variables ?
In the beginning there were only machine code, later came assemble language in which word has been assigned to operation codes ( add, sub, mul). These codes known as mnemonic.
Still people felt difficulties in coding, then came high level language. Now what their developer did, they just though that assembler( who convert from assemble to machine code) is already available and if we can convert our high level code into assembly we no more need to worry about conversion to machine code.
So they used assembler in their compiler internally.
Memory allocation is done at compile or run time both. When we declare variable, they take memory at compile time but malloc function used to allocate memory at run time.
assembler is transltor that convers assembly language into machine....that can easily undrstand by computer
Great video!
thanks
Good man
May I know from where did you made these awesome ppts?
This is made in microsoft powerpoint
thank you
Screenshot kis book k h🧐
So every library must contain the object file .o so that linker can link
to those object file present in library. So say, if object file is not
present in the library on which our program is dependent, then the
linker cannot link those libraries with our code. We cannot simply ship
cpp files as a library. Am i right?
+Mojo Jojo yes. CPP files will not work. Only object files also not sufficient. You have to create library which includes that object files.
So there should be .lib file as well as .obj . If so then can you please differentiate between what kind of code obj contains and what .lib contains and why there are 2 different things. Thanks for reply
+Mojo Jojo .lib file contains .obj plus code to map address like if dynamic library is used then in that library some mechanism is there which will load library into memory and include address into compiled file.
I hope it makes your concept clear.
In case any query feel free to ask.
Thank you. After you video and comment, things starts to make sense.
(you got a sub)
Thank you
Very nice video. but still need a video to clearify me on the issue of linking , relocating and loading
Thanks for appreciatoins
welcome to channel.....
Very nice explanation
# is not a comment. It's called the preprocessor directive. Am I right?
Nice job
very well explained'
Well done :)
+tHaTbASS You are welcome to Channel.
Super brother
Very good video.
Zaberdast
I think comments are removed in lexical analysis stage which is the part of compilation and not the preprocessor.
Who does that analysis
@@balancemyself which analysis are u referring to?
The lexical analysis you stated contrary to the preprocessor
your voice😍
Thanks a lot
welcome to the channel.
Thank you Saar
well explained ... thanks
Thanks for the comment.
good video
Are you laughing while recording?
Good video dude :))
❤
Thanks
huh ?! a C compiler generates "assembly code" and not machine code (object code) directly ?!
Compiler directly generates machine code and assembly code is generated as an intermediate step.
When we use compiler all we can see is object code. Assembly code is not saved on hard disk.
Good explanation
Tq
Thanks for the comment
thankyou sir
I love your voice here ❤
Omg...😂😂😂