In 54 Minutes, Understand the whole C and C++ compilation process

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ธ.ค. 2024

ความคิดเห็น • 161

  • @lucassilveira6449
    @lucassilveira6449 ปีที่แล้ว +40

    That was the best lecture about compilers on the whole internet. Thanks Mike!

    • @MikeShah
      @MikeShah  ปีที่แล้ว +1

      Cheers, thank you for the kind words!

    • @jorik170
      @jorik170 10 หลายเดือนก่อน

      couldn't agree more

  • @yanfranca8382
    @yanfranca8382 ปีที่แล้ว +30

    boy i wish i had seen this video when I was an undergrad

    • @MikeShah
      @MikeShah  ปีที่แล้ว +5

      Cheers! Yes, I show to all of my students -- it's essential knowledge in my book!

    • @birdinmotion1525
      @birdinmotion1525 2 หลายเดือนก่อน

      Bot am I glad I am an undergrad

  • @theroliyogi
    @theroliyogi 7 วันที่ผ่านมา +1

    Thanks Mike for your time, great video

    • @MikeShah
      @MikeShah  7 วันที่ผ่านมา

      You are most welcome!

  • @Cozy_Corner_official
    @Cozy_Corner_official 4 วันที่ผ่านมา +1

    Thank you feels like everything started making sense now...

    • @MikeShah
      @MikeShah  4 วันที่ผ่านมา

      Cheers!

  • @saberlite8809
    @saberlite8809 ปีที่แล้ว +7

    Impeccable explanation. I wish my college had professors like you who would explain the nitty gritty details and not just go through presentation slides.

    • @MikeShah
      @MikeShah  ปีที่แล้ว +2

      Cheers, thank you for the kind words!

  • @jovannyswicktutorials9960
    @jovannyswicktutorials9960 7 หลายเดือนก่อน +4

    This is special and deserves more views and likes. Well explained.

    • @MikeShah
      @MikeShah  7 หลายเดือนก่อน

      Cheers, thank you!

  • @zikangxiong6931
    @zikangxiong6931 2 ปีที่แล้ว +11

    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!

    • @MikeShah
      @MikeShah  2 ปีที่แล้ว +1

      Thank you for the kind words 🙂 I try to make the videos I wish I had when learning such topics. Welcome to the community!

  • @N03n03-e5y
    @N03n03-e5y 2 ปีที่แล้ว +4

    Bro this channel is soo damn underrated-- you should have like billion views on this video and billion subscribers

    • @MikeShah
      @MikeShah  2 ปีที่แล้ว

      Thank you for the kind words! :) Feel free to share

  • @kjollyman241
    @kjollyman241 3 ปีที่แล้ว +12

    I still watch these even after graduating 😅 thank you for the hard work!

    • @MikeShah
      @MikeShah  3 ปีที่แล้ว

      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 :)

  • @samarthtandale9121
    @samarthtandale9121 9 หลายเดือนก่อน +2

    Thank you for the valuable lecture Sir!

    • @MikeShah
      @MikeShah  9 หลายเดือนก่อน +1

      Cheers, you are most welcome!

  • @ДмитроЛизун-у2я
    @ДмитроЛизун-у2я 10 หลายเดือนก่อน +2

    Thank you for making difficult things seem easy 😍

    • @MikeShah
      @MikeShah  10 หลายเดือนก่อน

      Cheers!

  • @nik-ys8ki
    @nik-ys8ki 5 หลายเดือนก่อน +2

    Very good and explained video ,this is called quality content 😃

    • @MikeShah
      @MikeShah  5 หลายเดือนก่อน

      Cheers!

  • @oscarmvl
    @oscarmvl 2 ปีที่แล้ว +8

    What a great video! It was great to find such a cohesive video about the compiling process, thank you for creating this!

    • @MikeShah
      @MikeShah  2 ปีที่แล้ว +1

      You are most welcome!

  • @sabrinagschwendtner276
    @sabrinagschwendtner276 3 ปีที่แล้ว +15

    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

    • @MikeShah
      @MikeShah  3 ปีที่แล้ว +1

      You're welcome! Please suggest if anything else remains unclear

  • @min-yenlu1119
    @min-yenlu1119 3 ปีที่แล้ว +4

    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.

  • @olegwizex588
    @olegwizex588 3 ปีที่แล้ว +6

    Thank you! Great video and explanation.

  • @willianpessoa1011
    @willianpessoa1011 8 หลายเดือนก่อน +2

    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.

    • @MikeShah
      @MikeShah  8 หลายเดือนก่อน

      Cheers, thank you for the kind words! I'm very happy this helped!

  • @nikolasyo1383
    @nikolasyo1383 ปีที่แล้ว +2

    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.

    • @MikeShah
      @MikeShah  ปีที่แล้ว

      Cheers, happy to have helped!

  • @dontbemadsunshine
    @dontbemadsunshine 3 ปีที่แล้ว +3

    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!

    • @MikeShah
      @MikeShah  3 ปีที่แล้ว +2

      Awesome glad this was helpful! Good luck with your master's!

  • @husenpatel9381
    @husenpatel9381 5 หลายเดือนก่อน +1

    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
      @MikeShah  5 หลายเดือนก่อน +1

      Indeed -- somehow it mostly all works :)

  • @peyman_shabani
    @peyman_shabani ปีที่แล้ว +1

    Thanks Mike it was really great, I watched whole video non stop❤😅

    • @MikeShah
      @MikeShah  ปีที่แล้ว

      Excellent!

  • @kleinv7212
    @kleinv7212 6 หลายเดือนก่อน +1

    Bless you bro, thanks a bunch. It's very understandable👍🏻

    • @MikeShah
      @MikeShah  6 หลายเดือนก่อน

      Cheers!

  • @lln6123
    @lln6123 7 หลายเดือนก่อน +1

    great explanation! Nice to see a Linux command-line approach, since now I just saw Visual Studio

    • @MikeShah
      @MikeShah  7 หลายเดือนก่อน

      Cheers!

  • @nicholasziglio
    @nicholasziglio 8 หลายเดือนก่อน +1

    Thanks, this was really informative and useful!

    • @MikeShah
      @MikeShah  8 หลายเดือนก่อน

      Cheers!

  • @circuitsofaim
    @circuitsofaim 2 หลายเดือนก่อน +2

    Amazing !! thanks

  • @trido3815
    @trido3815 ปีที่แล้ว +2

    Very good instructions. Thx.

    • @MikeShah
      @MikeShah  ปีที่แล้ว

      Thank you for the kind words!

  • @pabloqp7929
    @pabloqp7929 2 ปีที่แล้ว +1

    omg how good is this 🔥💫🌿

    • @MikeShah
      @MikeShah  2 ปีที่แล้ว +1

      Cheers!

  • @yumiyonashi8518
    @yumiyonashi8518 6 หลายเดือนก่อน +1

    thank you sir..Helps a lot..

    • @MikeShah
      @MikeShah  6 หลายเดือนก่อน

      Cheers!

  • @mostafaelgablawy164
    @mostafaelgablawy164 3 ปีที่แล้ว +2

    thank you sir that's a great vedio I have ever seen about compilations

    • @MikeShah
      @MikeShah  3 ปีที่แล้ว +1

      You are most welcome!

    • @mostafaelgablawy164
      @mostafaelgablawy164 3 ปีที่แล้ว

      @@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

    • @MikeShah
      @MikeShah  3 ปีที่แล้ว +1

      @@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)

    • @mostafaelgablawy164
      @mostafaelgablawy164 3 ปีที่แล้ว +1

      @@MikeShah thank you so much

  • @saivivekvalluru1369
    @saivivekvalluru1369 ปีที่แล้ว +1

    Loved it! Really very useful info for c++ developer like me

  • @caiodavi9829
    @caiodavi9829 4 หลายเดือนก่อน +1

    thanks! it helped me a lot

    • @MikeShah
      @MikeShah  4 หลายเดือนก่อน

      Cheers!

  • @oribuun
    @oribuun ปีที่แล้ว +1

    Thank you so much for this amazing tutorial!

    • @MikeShah
      @MikeShah  ปีที่แล้ว +1

      Cheers, you are most welcome!

  • @DCKUR
    @DCKUR 2 ปีที่แล้ว +2

    Very detailed, thanks for creating this video :)

    • @MikeShah
      @MikeShah  2 ปีที่แล้ว

      Thank you for the kind words!

  • @DocteurZeuhl
    @DocteurZeuhl ปีที่แล้ว +2

    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 ❤

  • @wika96
    @wika96 2 ปีที่แล้ว +1

    Great video Mike. Thank you very much.

  • @jfr644
    @jfr644 8 หลายเดือนก่อน

    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

  • @NaveenKumar-cd8qh
    @NaveenKumar-cd8qh 2 ปีที่แล้ว +1

    Nice explanation, keep doing best 🙂

    • @MikeShah
      @MikeShah  2 ปีที่แล้ว

      Thank you for the kind words!

  • @startengine8838
    @startengine8838 2 ปีที่แล้ว +1

    Awesome video. Very well explained

    • @MikeShah
      @MikeShah  2 ปีที่แล้ว

      Cheers, thank you for the kind words!

  • @somenkumardas9839
    @somenkumardas9839 2 ปีที่แล้ว

    A very good video... Very much enjoyed the learning. Thank you for the video.

    • @MikeShah
      @MikeShah  2 ปีที่แล้ว

      Cheers, thank you for the kind words!

  • @englishlnowledge486
    @englishlnowledge486 11 หลายเดือนก่อน +1

    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!

    • @MikeShah
      @MikeShah  11 หลายเดือนก่อน

      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

  • @juniorrokudevelopertutoria3734
    @juniorrokudevelopertutoria3734 3 วันที่ผ่านมา +1

    Interesting lecture

    • @MikeShah
      @MikeShah  2 วันที่ผ่านมา

      Cheers!

  • @creator_wizard_seth
    @creator_wizard_seth ปีที่แล้ว +1

    youre a genius

    • @MikeShah
      @MikeShah  ปีที่แล้ว

      Cheers, thank you for the kind words!

  • @KeplerEmeritus
    @KeplerEmeritus 2 ปีที่แล้ว +2

    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?

    • @MikeShah
      @MikeShah  2 ปีที่แล้ว

      You are most welcome! Yes it's fun to see and know how it all comes together!

  • @guilherme5094
    @guilherme5094 5 หลายเดือนก่อน +1

    👏👏👏Great!

  • @samdavepollard
    @samdavepollard ปีที่แล้ว +1

    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. :-)

    • @MikeShah
      @MikeShah  ปีที่แล้ว

      Cheers thank you for the kind words! I agree, knowing how the tools work is very important 🙂

  • @stuartedward2965
    @stuartedward2965 ปีที่แล้ว +1

    very helpful! thank you

  • @ieduardoms
    @ieduardoms ปีที่แล้ว

    Thank you very much. It was really valuable.

  • @Passions
    @Passions 9 หลายเดือนก่อน +1

    I would have never failed CS if you were my professor!!!!

    • @MikeShah
      @MikeShah  9 หลายเดือนก่อน

      Cheers, that's very kind! Always time to learn more :)

  • @Kirmo13
    @Kirmo13 ปีที่แล้ว +1

    I've never thought of using gimp as a whiteboard!

  • @kacperkrol4394
    @kacperkrol4394 ปีที่แล้ว +1

    Great work!

    • @MikeShah
      @MikeShah  ปีที่แล้ว

      Thank you! Cheers!

  • @muhammetkocak6903
    @muhammetkocak6903 10 หลายเดือนก่อน +1

    I hope you make video series about makefile and cmake

    • @MikeShah
      @MikeShah  10 หลายเดือนก่อน

      Cheers, I am thinking more about this :)

    • @muhammetkocak6903
      @muhammetkocak6903 10 หลายเดือนก่อน +1

      @@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

    • @MikeShah
      @MikeShah  10 หลายเดือนก่อน

      Cheers -- thank you for the kind words!@@muhammetkocak6903

  • @deutschWallah
    @deutschWallah 3 หลายเดือนก่อน +1

    Fantastic Mike :)

    • @MikeShah
      @MikeShah  3 หลายเดือนก่อน

      @@deutschWallah cheers!

  • @tamajitbanerjee640
    @tamajitbanerjee640 3 ปีที่แล้ว

    Thank you, sir !! The content was very good.

  • @Ab_Irato
    @Ab_Irato 8 หลายเดือนก่อน +1

    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.

    • @MikeShah
      @MikeShah  8 หลายเดือนก่อน

      As I understand, I *think* 'gcc -E' is just invoking or rather telling the compiler to stop after running 'cpp'

  • @behrampatel4872
    @behrampatel4872 3 หลายเดือนก่อน +1

    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

    • @MikeShah
      @MikeShah  3 หลายเดือนก่อน +1

      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)

  • @310gowthamsagar5
    @310gowthamsagar5 10 หลายเดือนก่อน +1

    this is great !

    • @MikeShah
      @MikeShah  10 หลายเดือนก่อน

      Cheers!

  • @r00ty
    @r00ty ปีที่แล้ว +4

    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

    • @MikeShah
      @MikeShah  ปีที่แล้ว +1

      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.

    • @r00ty
      @r00ty ปีที่แล้ว +1

      hey@@MikeShah , did you delete my response?

    • @MikeShah
      @MikeShah  ปีที่แล้ว +2

      @@r00ty Nope, sorry if it got lost! Sometimes TH-cam deleted perfectly fine comments 🤷

  • @p.f.a.l.n.2280
    @p.f.a.l.n.2280 11 หลายเดือนก่อน

    Thank you! So nice to find informative videos like this without a thick accent to parse

  • @AteshEfe
    @AteshEfe 4 หลายเดือนก่อน +1

    how can i use terminal like that?

    • @MikeShah
      @MikeShah  4 หลายเดือนก่อน

      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/

  • @ashkrish7537
    @ashkrish7537 3 ปีที่แล้ว +1

    Great content professor. 🙏🏻🙏🏻✌🏻✌🏻

  • @EarlyBitcoiner
    @EarlyBitcoiner ปีที่แล้ว +1

    Very good explenation! thank you! I start wondering now, what is the exe file and how it works?

    • @MikeShah
      @MikeShah  ปีที่แล้ว

      Cheers! Take a look at pe and elf formats 🙂

  • @InsocialDev
    @InsocialDev 11 หลายเดือนก่อน +2

    We got the same last name ,mine is Shah too. Meet Shah

    • @MikeShah
      @MikeShah  11 หลายเดือนก่อน

      Excellent!

  • @jeffsad8391
    @jeffsad8391 6 หลายเดือนก่อน +1

    I have question:As begginner what should you learn first math or computer arhitecture ?

    • @MikeShah
      @MikeShah  6 หลายเดือนก่อน

      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 :)

    • @jeffsad8391
      @jeffsad8391 6 หลายเดือนก่อน +1

      @@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

    • @MikeShah
      @MikeShah  6 หลายเดือนก่อน +1

      @@jeffsad8391 Start with a simple project (e.g. a game) and learn as you go.

    • @jeffsad8391
      @jeffsad8391 6 หลายเดือนก่อน +1

      @@MikeShah like a little project?

    • @MikeShah
      @MikeShah  6 หลายเดือนก่อน

      @@jeffsad8391 exactly! Believe it or not, even the simplest of projects will reveal what to learn 🙂

  • @yashdeshmukh2662
    @yashdeshmukh2662 2 ปีที่แล้ว +1

    thanks

    • @MikeShah
      @MikeShah  2 ปีที่แล้ว +1

      Cheers, you are most welcome!

  • @coolwinder
    @coolwinder 7 หลายเดือนก่อน +1

    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?

    • @MikeShah
      @MikeShah  7 หลายเดือนก่อน +1

      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
      @coolwinder 7 หลายเดือนก่อน +1

      @@MikeShah executable object, wuut, i am in suspece now... will there be another part?

    • @MikeShah
      @MikeShah  7 หลายเดือนก่อน +1

      @@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

    • @coolwinder
      @coolwinder 7 หลายเดือนก่อน +1

      @MikeShah i can't wait then! Truly amazing content! :)

    • @MikeShah
      @MikeShah  7 หลายเดือนก่อน +1

      Cheers ​@@coolwinder

  • @peyman_shabani
    @peyman_shabani ปีที่แล้ว

    Mike could you please record some videos about Make or CMake, it will be great. 😊❤

    • @MikeShah
      @MikeShah  ปีที่แล้ว

      Starting to plan something for Make. 👍

  • @azeemali6865
    @azeemali6865 8 หลายเดือนก่อน +1

    Command 'xdot' not found

    • @MikeShah
      @MikeShah  8 หลายเดือนก่อน +1

      What command did you run? 'xdot' is a program you can likely install on your package manager.

    • @azeemali6865
      @azeemali6865 8 หลายเดือนก่อน +1

      @@MikeShah yes... After installing it's now working...

  • @ДимаК-в7е
    @ДимаК-в7е ปีที่แล้ว +1

    Thank you for this tutorial. Please open terminal in full screen next time, drawings does not fit in half screen anyway.

  • @HackDiary1
    @HackDiary1 4 หลายเดือนก่อน

    39:41

  • @edhermisaelcarbajalrosales1613
    @edhermisaelcarbajalrosales1613 ปีที่แล้ว

    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.

  • @zfl1981
    @zfl1981 5 หลายเดือนก่อน +1

    Now do modules 😅

    • @MikeShah
      @MikeShah  5 หลายเดือนก่อน

      That's the plan for the next video 😁

  • @mnj1
    @mnj1 2 ปีที่แล้ว +1

    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.

    • @MikeShah
      @MikeShah  2 ปีที่แล้ว

      True that a interpreted languages and JIT compiled languages go through different variations (or even omit) some of the stages.

  • @Coding-to4zj
    @Coding-to4zj 10 หลายเดือนก่อน

    twisting simple concepts. do you have adhd? just write down what you want to talk about its so unefficient

  • @webcamdiary
    @webcamdiary ปีที่แล้ว +1

    Thanks a bunch!