Skip to content
0:00 / 0:00

#compilation#linker#preprocessor

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

Mike Shah

42K subscribers • 2 videos on Hallway

YouTube
  • Recommended by 2 people: 2 in engineering communities.
  • Presented by Mike Shah

Intermediate. Assumes working knowledge.

115K views5 years ago2 recommendations

Programming languagesSystems programmingCompilers and interpretersBuild systems and packagingC++

Mike Shah explains the entire C and C++ compilation process, including preprocessing, compilation, assembly, and linking.

►C++ Series Playlist: youtube.com/playlist?list=PLvv0ScY6vfd8j-tlhYVPYgiIyXduu6m-L ►Find full courses on: courses.mshah.io/ ►Join as Member to Support the channel: youtube.com/channel/UCA64pZbN5Mz5NxC3SO4qpDg/join ►Lesson Description: I've seen enough folks struggle with compiling in C and C++ that it is time for a full video to understand the process. As a result of understanding the compilation process, you can understand why a project should be split into smaller components, and how that makes your code faster to compile, easier to debug, and dare I say...more fun to work with! Introduction High Level Overview of Compilation Simple Project Setup Compiling Preprocessor output All functions are extern Syntax error versus linking error successful compile of multiple sources Redefinition errors Header Guards Compiler at a high level g++ syntax tree visualization Assembly Overview and Output Outputting object file (.o) Compiling Files Individually Linking o files together objdump Dynamically linked libraries ldd dynamially linked shared libraries Summary and Recap Practical Example with SFML Library Compiling without linking libraries error Linking in the correct libraries Using the -L flag to find library PATH and environment variables for default search paths Include Path Fixing Include Path Errors What your IDE is hiding from you. ►YouTube Channel: youtube.com/c/MikeShah ►Please like and subscribe to help the channel! ►Join our free community: courses.mshah.io/communities/Q29tbXVuaXR5LTI3MzAz

Why it's here

2 people recommend this

What people say. Recommended as an insightful and clear overview of how C and C++ compilation and linking work.

u/ad_iratoin r/GraphicsProgramming • Recommends

On “GLFW refuses to work”

here's a wonderful video from Mike Shah: [video if you need more details.

u/Devilspotin r/C_Programming • Recommends

On “Where can I start learning about C-surrounding stuff?”

This was a very insightful overview, maybe it helps: link to this video