Ever wondering what’s the meaning of xyz@?$abc@V?$def@H@@PAX@@ when getting linking error? Not again, because now you can read it easily only by finishing this!
First, what is it?
Compiler need to pass information to linker so linker able to link object code correctly, but linker and compiler have to talk with one language. That’s how this C++ name mangling invented, bad news is there is no standard of this name mangling (Right! Microsoft has its own mangling scheme). What we know about visual C++ name mangling is only based on reverse engineer because Microsoft doesn’t release any documentation about it.
How to read it ?
You can read this article for complete table and scheme “reverse engineered” specification, but I will introduce you to the basic principle.
1. Read it in reversed order
2. It has structure :
a. Prefix ?
b. Optional prefix : @
c. Qualified name
d. Type of information
3. Look scheme documentation
void __cdecl abc<def<int>,void*>::xyz(void)
It will become :
1. abc<def<int>,void*>::xyz 2. xyz@ abc<def<int>,void*> @ 3. xyz@ ?$abc@ def<int> void* @ @ 4. xyz@ ?$abc@ V def<int> @ PAX @ @ 5. xyz@ ?$abc@ V ?$def@H@ @ PAX @ @ 6. xyz@?$abc@V?$def@H@@PAX@@
But that’s too complicated and not practical!
Yes, I know. Let’s find another way, there is always another way to Rome right?
In your visual c++ toolkit directory you can find undname, use it to translate this unhuman text to readable and friendlier text.
Wanna do some research, create parser for this languange?
This is good starting point for you, basically I just rewrite information from this sources :