Reputation: 19
i would like to understand the @@YAHXZ
part of such an error:
Error LNK2019 unresolved external symbol "int __cdecl func2(void)" (?func2@@YAHXZ) referenced in function _main .
this is just one example but i've seen other types of strange letters i just dont remember them right now. where can i find an explanation on each of them?
Upvotes: 0
Views: 317
Reputation: 53970
This is called «name mangling», or «name decoration».
As C++ supports function overloading, the name of the symbols are generated in a specific way, usually based on the argument's types.
Here's the official documentation on Microsoft website:
https://msdn.microsoft.com/en-us/library/56h2zst2.aspx
EDIT
Microsoft doesn't provide a complete documentation about name decoration.
If you're interested in knowing exactly what the symbols mean, I recommend reading Agner Fog's documentation on calling conventions:
http://www.agner.org/optimize/calling_conventions.pdf
Upvotes: 4