Products
Features
YouTube Video Summarizer
Summarize YouTube videos
Web & PDF Highlighter
Highlight web pages & PDFs
Chat with PDF
Ask any PDF questions with AI
Ask AI Clone
Chat with your highlights & memories
Audio Transcriber
Transcribe audio files to text
Glasp Reader
Read and highlight articles
Kindle Highlight Export
Export your Kindle highlights
Idea Hatch
Hatch ideas from your highlights
Integrations
Obsidian Plugin
Notion Integration
Pocket Integration
Instapaper Integration
Medium Integration
Readwise Integration
Snipd Integration
Hypothesis Integration
Apps & Extensions
Chrome Extension
Safari Extension
Edge Add-ons
Firefox Add-ons
iOS App
Android App
Discover
Discover
Ideas
Discover new ideas and insights
Articles
Curated articles and insights
Books
Book recommendations by great minds
Posts
Essays and notes from readers
Quotes
Inspiring quotes collection
Videos
Curated videos and summaries
Explore Glasp
Glasp Newsletter
Weekly insights and updates
Glasp Talk
Interview series with great minds
Glasp Blog
Latest news and articles
Glasp Use Cases
Learn how others use Glasp
Build & Support
Glasp API
Access Glasp's API for developers
MCP Connector
Connect Glasp to Claude & ChatGPT
Community
Glasp Reddit Community
Students
Student discount and benefits
FAQs
Frequently Asked Questions
AboutPricing
DashboardLog inSign up

How the C++ Linker Works

570.3K views
•
April 23, 2017
by
The Cherno
YouTube video player
How the C++ Linker Works

TL;DR

Linking is the process of combining separate object files into one executable program, and it involves finding and connecting symbols and functions.

Transcript

hey little guys my name is Deshawn oh and today we're going to talk about linking so what is linking what does the simple spot linker actually do linking is a process that we go through when we go from our source surface plus files to our actual executable binary so the first stage is actually compiling our source files and I actually made an entir... Read More

Key Insights

  • 🛠️ Linking is the process of combining separate object files into one program, allowing them to interact and creating an executable binary.
  • 🗄️ The primary purpose of the linker is to find and link together symbols and functions from different files, even if they are compiled into separate object files.
  • 📚 Even if a program is written in a single file, the linker still needs to know where the entry point (main function) is so that it can start executing the code from there.
  • 💻 Differentiating between the compilation and linking stages can be done in Visual Studio by pressing ctrl f7 (compiling) or building the project or pressing f5 (compiling and linking).
  • 🔍 Linking errors can occur during the linking stage and are indicated by error codes beginning with "LNK". Differentiating between compiling and linking errors is important for proper troubleshooting.
  • 🚀 Compiling errors occur when there are syntax errors and are indicated by error codes beginning with "C". The compiler can catch these errors during the compilation stage.
  • 🔧 Unresolved external symbol errors occur when the linker cannot find a symbol (function or variable) that it needs for linking. This can happen if the symbol is not defined in any of the object files.
  • 🔄 Duplicate symbols errors occur when there are two or more identically named functions with the same return value and parameters. This can be fixed by making the function static, inline, or by moving the definition to a single translation unit.

Install to Summarize YouTube Videos and Get Transcripts

Explore YouTube Video Summarizer or Get YouTube Transcript Extractor

Questions & Answers

Q: What is the purpose of linking in programming?

The purpose of linking in programming is to combine separate object files into one executable program, connecting symbols and functions from different files.

Q: What happens during the compilation stage of the linking process?

During the compilation stage, source files are transformed into object files, and each object file is a separate translation unit with no relation to each other.

Q: What is the role of the linker in finding symbols and functions?

The linker's main role is to find where each symbol and function is located and link them together, allowing files to interact and form a complete program.

Q: Can linking errors occur even if all functions are in one file?

Yes, linking errors can still occur even if all functions are in one file. For example, the application still needs to locate the entry point (usually the main function) for execution.

Q: How can you differentiate between compilation errors and linking errors?

Compilation errors, such as syntax errors, are prefixed with "C" in the error code, while linking errors are prefixed with "LnK" and indicate issues during the linking stage.

Q: What can cause unresolved external symbol errors during linking?

Unresolved external symbol errors occur when the linker cannot find symbols or functions that are referenced in the code, indicating missing definitions or duplicate symbols.

Q: What is the significance of marking a function as static?

Marking a function as static limits its scope to the current translation unit, preventing it from being visible to other object files and avoiding potential duplicate linking errors.

Q: How can linking errors be resolved when there are duplicate symbols?

Duplicate symbol errors can be resolved by ensuring that each symbol has a unique definition and by organizing the code to avoid conflicts, such as moving definitions to separate translation units.

Summary & Key Takeaways

  • Linking is the process of combining separate object files into one executable program.

  • The linker's main purpose is to find and link symbols and functions from different files.

  • Linking errors can occur when symbols or functions are missing, or when there are duplicate symbols.


Read in Other Languages (beta)

English

Share This Summary 📚

Summarize YouTube Videos and Get Video Transcripts with 1-Click

Download browser extensions on:

Try YouTube Summary with ChatGPT & Claude or YouTube Transcript Generator

Explore More Summaries from The Cherno 📚

What Are Pointers in C++ and How Do They Work? thumbnail
What Are Pointers in C++ and How Do They Work?
The Cherno
What Does the Static Keyword Mean in C++ Classes? thumbnail
What Does the Static Keyword Mean in C++ Classes?
The Cherno
The "this" keyword in C++ thumbnail
The "this" keyword in C++
The Cherno
What Is the Difference Between Structs and Classes in C++? thumbnail
What Is the Difference Between Structs and Classes in C++?
The Cherno
Welcome to OpenGL thumbnail
Welcome to OpenGL
The Cherno
DESIGNING our GAME ENGINE thumbnail
DESIGNING our GAME ENGINE
The Cherno

Summarize YouTube Videos and Get Video Transcripts with 1-Click

Download browser extensions on:

Try YouTube Summary with ChatGPT & Claude or YouTube Transcript Generator

Apps & Extensions

  • Chrome Extension
  • Safari Extension
  • Edge Add-ons
  • Firefox Add-ons
  • iOS App
  • Android App

Key Features

  • YouTube Video Summarizer
  • Web & PDF Summarizer
  • Web & PDF Highlighter
  • Chat with PDF
  • Ask AI Clone
  • Audio Transcriber
  • Glasp Reader
  • Kindle Highlight Export
  • Idea Hatch

Integrations

  • Obsidian Plugin
  • Notion Integration
  • Pocket Integration
  • Instapaper Integration
  • Medium Integration
  • Readwise Integration
  • Snipd Integration
  • Hypothesis Integration

More Features

  • APIs
  • MCP Connector
  • Blog & Post
  • Embed Links
  • Image Highlight
  • Personality Test
  • Quote Shots

Company

  • About us
  • Blog
  • Community
  • FAQs
  • Job Board
  • Newsletter
  • Pricing
Terms

•

Privacy

•

Guidelines

© 2026 Glasp Inc. All rights reserved.