Impeccable explanation. I wish my college had professors like you who would explain the nitty gritty details and not just go through presentation slides.
This video gives quite a practical overview. Tools like ldd and those flags are really most frequently used in any meaningful projects. Only those who really use C/C++ can summarize it in such a concise but practical way!
Thanks Kraig! Th plan is to keep making and releasing more publicly! Now that you've been out working for a bit, we'll have to have you come back as a guest speaker for Fall 2021 FSE course :)
Thank you for this video! It helped me understand a lot of concepts that I missed or that weren't even included in my lectures in the first place. I have my bachelor's exam in a little over a week, so I am currently trying to fill the gaps in my knowledge and you definitely helped me with that! :D
This is a really great video!!! I hope that I could see it when I started learning programming.... This contains everything you need to learn for compiling process.... It would have spared lots of wasted time.
This video has been incredibly helpful to me. Thank you for sharing. I've been a subscriber to your channel for some time now. I stumbled upon it while researching Design Patterns (which I'm still trying to master), but this video greatly assisted me in completing a questionnaire for my Computer Science Coursea at UFRJ I genuinely appreciate your content and aspire to become a professional like you in the future.
Nice Video!!! So many things make sense now. I tried to include SDL in my C++ project on windows some days ago. Sould have watched this video before. would have saved me a lot of trouble.
This is awesome. Im doing a masters in a.i. next year and we will be having to use a lot of different languages throughout the course, i thought learning c/c++ would be advantageous as my first language. Thanks you very much for this!
Its amazing to figure out how many layers of abstraction we are living upon. not to mention python or javascript like langauges which are much higher level than c++.
@@MikeShah please I have a question when we include more times in several obj files what we had include exactly I found all the functions of iostream in every obj file I thought that I will get a linker error but that wasn't happen
@@mostafaelgablawy164 You mean none of the functions have been found? When you #include then you gain access to each of the functions (iostream provides the declarations in the header file). The appropriate libstd++ libraries will then be linked by the linker to implement those functions (e.g, std::cout)
Thank you so much for this video. It really helped me put together every piece of information I have gathered along the way so far, and already gave me ideas on how to solve the (pretty sophisticated) linking issues I am currently facing. Incredible video ❤
Thank you for the great explanation! The only thing that raised doubts was the $PATH variable. It seems, it only indicates the location of the programs binaries to be executed within the shell without specifying their full path, not the shared libraries paths (resolving them by g++ seems to be more complicated since it is not controlled only with environment variables). The whole idea is clear though
Most underrated channel, Such explanation not able to find on other youtube channel or even paid courses, Have you provide your course on udemy??? Thank You!
Dude. Thanks. The most informative and comprehensive video I’ve found on the topic. Unfortunately, quenching this thirst gave me the hunger to dive deeper again… I want to see what assembled machine code looks like in the file… would we just see 1s and 0s?
Superb video. Super useful. Many Thanks for sharing your knowledge. Easy sub. As an old fart hobbyist, currently getting back into C++, I'm amazed how few C++ resources, be they books or online courses, cover this build stuff in any detail. It seems most of them want you installing Visual Studio etc on day one, then there's a bit of magic hand waving, assuring you that the IDE will take care of all these things, and I'm sure it will, but I do like to know what my tools are doing for me. Then I try to install raylib and I become painfully aware that I don't have a clue about building from the command line. Again, Many Thanks for sharing your knowledge. I really like your teaching style. I noticed you have series on C++ itself, and also SDL2. I have a feeling I may end up using SDL2 instead of raylib. :-)
Hey Mike, bit of weird question but is there a reason to use gcc -E foo.cpp over cpp foo.cpp, i sort of understood the nont traditional mode in gnu but would sort of like your take on it.
Fantastic as usual. One thing that tripped me up on windows using the SDL library and ms vc++ is that we have to include a copy of an external dll file in the same folder as the binary. e.g copy the sdl2 dll in the folder where the exe is generated in order for the project to run. Is this also the case with linux ? Cheers, b
Cheers! For windows, linux, and mac there are default locations where processes will look for libraries (including the current directory). So for linux I believe when I install on a package manager, the .so file for SDL is put in a location that the system searches for by default :) (Thus no need to copy file into same directory)
so, just to avoid confusions please note nowadays (2023) - it's not really true that compiler outputs assembly code. GCC is the exception tho clang/LLVM, MSVC, and ICC all produce machine code directly
Source? I imagine most every optimizing compiler would be building an intermediate representation that is 'assembly-like' (LLVM it is bitcode or IR, gcc GIMPLE), and then generating machine code (assembly) after. Probably true if you've got the assembly you would just directly generate the object file (or maybe the executable object file if they wanted) -- but I'd be curious to learn more.
I have a video on the terminal here: th-cam.com/video/pTVxZHWsJnU/w-d-xo.html and Tmux (to get the splits) here: th-cam.com/video/8fzvPz5P0Q4/w-d-xo.html in the future I'll have a course on terminal with all of these skills and more on courses.mshah.io/
Probably best to learn a little of both as you go along -- however, if you start learning computer architecture, when there's some math you don't understand, you take the time to learn that math before proceding. So you don't necessarily have to learn one in a silo :)
@@MikeShah but what is order în learning? Math,computer arhitecture and organization,bios,operating system=what is the order to learn ? Beceause I need help
29:29 - If you are not providing an -c, which would enable valid gcc run, without a need of full source file, as onlt object file will be produced... Why are you naming the output which would now be an executable with .o extension?
At 29:58 I mention that indeed this does not make sense to do :) I'm slowly introducing the idea of executable object files versus regular object files that can be linked together.
@@coolwinder I will indeed 🙂 There's actually (at least) 3 types of object files -- shareable, executable, and the static files with .o. We just call them by different names, but they're all 'object' files
tldr; Useful flags when compiling with gcc -E Preprocess only; do not compile, assemble or link. -S Compile only; do not assemble or link. -c Compile and assemble, but do not link.
Well, the Java or JavaScript way of doing things is completely different from C/C++, so your introduction is not completely accurate. JS is an interpreted language and Java is a language that relies on a virtual machine and intermediary language.
That was the best lecture about compilers on the whole internet. Thanks Mike!
Cheers, thank you for the kind words!
couldn't agree more
boy i wish i had seen this video when I was an undergrad
Cheers! Yes, I show to all of my students -- it's essential knowledge in my book!
Bot am I glad I am an undergrad
Thanks Mike for your time, great video
You are most welcome!
Thank you feels like everything started making sense now...
Cheers!
Impeccable explanation. I wish my college had professors like you who would explain the nitty gritty details and not just go through presentation slides.
Cheers, thank you for the kind words!
This is special and deserves more views and likes. Well explained.
Cheers, thank you!
This video gives quite a practical overview. Tools like ldd and those flags are really most frequently used in any meaningful projects. Only those who really use C/C++ can summarize it in such a concise but practical way!
Thank you for the kind words 🙂 I try to make the videos I wish I had when learning such topics. Welcome to the community!
Bro this channel is soo damn underrated-- you should have like billion views on this video and billion subscribers
Thank you for the kind words! :) Feel free to share
I still watch these even after graduating 😅 thank you for the hard work!
Thanks Kraig! Th plan is to keep making and releasing more publicly! Now that you've been out working for a bit, we'll have to have you come back as a guest speaker for Fall 2021 FSE course :)
Thank you for the valuable lecture Sir!
Cheers, you are most welcome!
Thank you for making difficult things seem easy 😍
Cheers!
Very good and explained video ,this is called quality content 😃
Cheers!
What a great video! It was great to find such a cohesive video about the compiling process, thank you for creating this!
You are most welcome!
Thank you for this video! It helped me understand a lot of concepts that I missed or that weren't even included in my lectures in the first place. I have my bachelor's exam in a little over a week, so I am currently trying to fill the gaps in my knowledge and you definitely helped me with that! :D
You're welcome! Please suggest if anything else remains unclear
This is a really great video!!! I hope that I could see it when I started learning programming....
This contains everything you need to learn for compiling process....
It would have spared lots of wasted time.
Thank you! Great video and explanation.
This video has been incredibly helpful to me. Thank you for sharing.
I've been a subscriber to your channel for some time now. I stumbled upon it while researching Design Patterns (which I'm still trying to master), but this video greatly assisted me in completing a questionnaire for my Computer Science Coursea at UFRJ
I genuinely appreciate your content and aspire to become a professional like you in the future.
Cheers, thank you for the kind words! I'm very happy this helped!
Nice Video!!! So many things make sense now. I tried to include SDL in my C++ project on windows some days ago. Sould have watched this video before. would have saved me a lot of trouble.
Cheers, happy to have helped!
This is awesome. Im doing a masters in a.i. next year and we will be having to use a lot of different languages throughout the course, i thought learning c/c++ would be advantageous as my first language. Thanks you very much for this!
Awesome glad this was helpful! Good luck with your master's!
Its amazing to figure out how many layers of abstraction we are living upon. not to mention python or javascript like langauges which are much higher level than c++.
Indeed -- somehow it mostly all works :)
Thanks Mike it was really great, I watched whole video non stop❤😅
Excellent!
Bless you bro, thanks a bunch. It's very understandable👍🏻
Cheers!
great explanation! Nice to see a Linux command-line approach, since now I just saw Visual Studio
Cheers!
Thanks, this was really informative and useful!
Cheers!
Amazing !! thanks
Very good instructions. Thx.
Thank you for the kind words!
omg how good is this 🔥💫🌿
Cheers!
thank you sir..Helps a lot..
Cheers!
thank you sir that's a great vedio I have ever seen about compilations
You are most welcome!
@@MikeShah please I have a question when we include more times in several obj files what we had include exactly I found all the functions of iostream in every obj file I thought that I will get a linker error but that wasn't happen
@@mostafaelgablawy164 You mean none of the functions have been found? When you #include then you gain access to each of the functions (iostream provides the declarations in the header file). The appropriate libstd++ libraries will then be linked by the linker to implement those functions (e.g, std::cout)
@@MikeShah thank you so much
Loved it! Really very useful info for c++ developer like me
Cheers!
thanks! it helped me a lot
Cheers!
Thank you so much for this amazing tutorial!
Cheers, you are most welcome!
Very detailed, thanks for creating this video :)
Thank you for the kind words!
Thank you so much for this video. It really helped me put together every piece of information I have gathered along the way so far, and already gave me ideas on how to solve the (pretty sophisticated) linking issues I am currently facing. Incredible video ❤
Cheers!
Great video Mike. Thank you very much.
Cheers!
Thank you for the great explanation!
The only thing that raised doubts was the $PATH variable. It seems, it only indicates the location of the programs binaries to be executed within the shell without specifying their full path, not the shared libraries paths (resolving them by g++ seems to be more complicated since it is not controlled only with environment variables). The whole idea is clear though
Nice explanation, keep doing best 🙂
Thank you for the kind words!
Awesome video. Very well explained
Cheers, thank you for the kind words!
A very good video... Very much enjoyed the learning. Thank you for the video.
Cheers, thank you for the kind words!
Most underrated channel, Such explanation not able to find on other youtube channel or even paid courses, Have you provide your course on udemy???
Thank You!
Cheers, thank you for the kind words 🙂 I have some courses here: courses.mshah.io/ -- I *may* consider also putting them on Udemy in the future
Interesting lecture
Cheers!
youre a genius
Cheers, thank you for the kind words!
Dude. Thanks. The most informative and comprehensive video I’ve found on the topic. Unfortunately, quenching this thirst gave me the hunger to dive deeper again… I want to see what assembled machine code looks like in the file… would we just see 1s and 0s?
You are most welcome! Yes it's fun to see and know how it all comes together!
👏👏👏Great!
Superb video. Super useful. Many Thanks for sharing your knowledge. Easy sub.
As an old fart hobbyist, currently getting back into C++, I'm amazed how few C++ resources, be they books or online courses, cover this build stuff in any detail. It seems most of them want you installing Visual Studio etc on day one, then there's a bit of magic hand waving, assuring you that the IDE will take care of all these things, and I'm sure it will, but I do like to know what my tools are doing for me. Then I try to install raylib and I become painfully aware that I don't have a clue about building from the command line.
Again, Many Thanks for sharing your knowledge. I really like your teaching style. I noticed you have series on C++ itself, and also SDL2. I have a feeling I may end up using SDL2 instead of raylib. :-)
Cheers thank you for the kind words! I agree, knowing how the tools work is very important 🙂
very helpful! thank you
Cheers!
Thank you very much. It was really valuable.
Cheers!
I would have never failed CS if you were my professor!!!!
Cheers, that's very kind! Always time to learn more :)
I've never thought of using gimp as a whiteboard!
Great work!
Thank you! Cheers!
I hope you make video series about makefile and cmake
Cheers, I am thinking more about this :)
@@MikeShah I saw you C++ course and I will dive into it soon. I like your teacing fluency and sound. this is important for me
Cheers -- thank you for the kind words!@@muhammetkocak6903
Fantastic Mike :)
@@deutschWallah cheers!
Thank you, sir !! The content was very good.
Hey Mike, bit of weird question but is there a reason to use gcc -E foo.cpp over cpp foo.cpp, i sort of understood the nont traditional mode in gnu but would sort of like your take on it.
As I understand, I *think* 'gcc -E' is just invoking or rather telling the compiler to stop after running 'cpp'
Fantastic as usual. One thing that tripped me up on windows using the SDL library and ms vc++ is that we have to include a copy of an external dll file in the same folder as the binary.
e.g copy the sdl2 dll in the folder where the exe is generated in order for the project to run.
Is this also the case with linux ?
Cheers,
b
Cheers! For windows, linux, and mac there are default locations where processes will look for libraries (including the current directory). So for linux I believe when I install on a package manager, the .so file for SDL is put in a location that the system searches for by default :) (Thus no need to copy file into same directory)
this is great !
Cheers!
so, just to avoid confusions please note nowadays (2023) - it's not really true that compiler outputs assembly code. GCC is the exception tho clang/LLVM, MSVC, and ICC all produce machine code directly
Source? I imagine most every optimizing compiler would be building an intermediate representation that is 'assembly-like' (LLVM it is bitcode or IR, gcc GIMPLE), and then generating machine code (assembly) after. Probably true if you've got the assembly you would just directly generate the object file (or maybe the executable object file if they wanted) -- but I'd be curious to learn more.
hey@@MikeShah , did you delete my response?
@@r00ty Nope, sorry if it got lost! Sometimes TH-cam deleted perfectly fine comments 🤷
Thank you! So nice to find informative videos like this without a thick accent to parse
how can i use terminal like that?
I have a video on the terminal here: th-cam.com/video/pTVxZHWsJnU/w-d-xo.html and Tmux (to get the splits) here: th-cam.com/video/8fzvPz5P0Q4/w-d-xo.html in the future I'll have a course on terminal with all of these skills and more on courses.mshah.io/
Great content professor. 🙏🏻🙏🏻✌🏻✌🏻
Very good explenation! thank you! I start wondering now, what is the exe file and how it works?
Cheers! Take a look at pe and elf formats 🙂
We got the same last name ,mine is Shah too. Meet Shah
Excellent!
I have question:As begginner what should you learn first math or computer arhitecture ?
Probably best to learn a little of both as you go along -- however, if you start learning computer architecture, when there's some math you don't understand, you take the time to learn that math before proceding. So you don't necessarily have to learn one in a silo :)
@@MikeShah but what is order în learning?
Math,computer arhitecture and organization,bios,operating system=what is the order to learn ?
Beceause I need help
@@jeffsad8391 Start with a simple project (e.g. a game) and learn as you go.
@@MikeShah like a little project?
@@jeffsad8391 exactly! Believe it or not, even the simplest of projects will reveal what to learn 🙂
thanks
Cheers, you are most welcome!
29:29 - If you are not providing an -c, which would enable valid gcc run, without a need of full source file, as onlt object file will be produced... Why are you naming the output which would now be an executable with .o extension?
At 29:58 I mention that indeed this does not make sense to do :) I'm slowly introducing the idea of executable object files versus regular object files that can be linked together.
@@MikeShah executable object, wuut, i am in suspece now... will there be another part?
@@coolwinder I will indeed 🙂 There's actually (at least) 3 types of object files -- shareable, executable, and the static files with .o. We just call them by different names, but they're all 'object' files
@MikeShah i can't wait then! Truly amazing content! :)
Cheers @@coolwinder
Mike could you please record some videos about Make or CMake, it will be great. 😊❤
Starting to plan something for Make. 👍
Command 'xdot' not found
What command did you run? 'xdot' is a program you can likely install on your package manager.
@@MikeShah yes... After installing it's now working...
Thank you for this tutorial. Please open terminal in full screen next time, drawings does not fit in half screen anyway.
Cheers!
39:41
tldr; Useful flags when compiling with gcc
-E Preprocess only; do not compile, assemble or link.
-S Compile only; do not assemble or link.
-c Compile and assemble, but do not link.
Now do modules 😅
That's the plan for the next video 😁
Well, the Java or JavaScript way of doing things is completely different from C/C++, so your introduction is not completely accurate. JS is an interpreted language and Java is a language that relies on a virtual machine and intermediary language.
True that a interpreted languages and JIT compiled languages go through different variations (or even omit) some of the stages.
twisting simple concepts. do you have adhd? just write down what you want to talk about its so unefficient
Thanks a bunch!
Cheers!