Top "Linkage" questions

Linkage describes how names can or can not refer to the same entity throughout the entire program or a single unit.

What is the effect of extern "C" in C++?

What exactly does putting extern "C" into C++ code do? For example: extern "C" { void foo(); }

c++ c linkage name-mangling extern-c
About inconsistent dll linkage

How can I remove this link warning? You can see code segment that causes this warning. static AFX_EXTENSION_MODULE …

c++ dll warnings linkage
Why do we need extern "C"{ #include <foo.h> } in C++?

Why do we need to use: extern "C" { #include <foo.h> } Specifically: When should we use it? What …

c++ linkage name-mangling extern-c
Determining C executable name

When we are compiling a C program the output is stored in a.out. How can we redirect the compiled …

c gcc compilation executable linkage
multiple definitions error in c++ and solution to solve this issue

I am new to C++. I have some doubts regarding multiple definitions error in C++. Let's say I have 3 files …

c++ compiler-errors linkage multiple-definition-error
Static functions declared in "C" header files

For me it's a rule to define and declare static functions inside source files, I mean .c files. However in …

c function static internal linkage
const variables in header file and static initialization fiasco

After reading a lot of the questions regarding initialization of static variables I am still not sure how this applies …

c++ initialization linkage
What are ld-linux.so.2 and linux-gate.so.1?

When I run ldd program I get an output of the form linux-gate.so.1 => (0xb77ae000) libstdc++.so.6 => /…

linux linkage ldd
Why can't templates be within extern "C" blocks?

This is a follow-up question to an answer to Is it possible to typedef a pointer-to-extern-“C”-function type within …

c++ templates extern linkage
extern enum in c++

I have an enum I have declared in some .h file: typedef enum { NONE, ONE, TWO, THREE } MYENUM; in a …

c++ syntax compilation extern linkage