Microsoft Visual C++ Name Mangling - Overview

Overview

The C++ language does not define a standard decoration scheme, so Microsoft Visual C++ uses its own.

Any object code produced by the compiler is usually linked with other pieces of object code by the linker. The linker relies on unique object names for identification but C++ (and many modern programming languages) allows different entities to be named with the same identifier as long as they occupy a different namespace. So names should be mangled by the compiler to make them distinct before reaching the linker. The linker also needs a great deal of information on each program entity. For example, to correctly link a function it needs its name, the number of arguments and their types, and so on.

C++ decoration can become fairly complex (storing information about classes, templates, namespaces, operator overloading, etc.). This section explains the specific manner in which the Microsoft Visual C++ series of compilers mangle symbol names.

Read more about this topic:  Microsoft Visual C++ Name Mangling