Troubleshooting name mangling issues

Has a name decoration spec been published for VC2005? I have an undefined external
__imp_?_S_next_size@?$_Stl_prime@_N@priv@std@@SGII@Z
which nearly matches
__imp_?_S_next_size@?$_Stl_prime@_N@priv@std@@SAII@Z
in an import lib. Presumably a major compiler or linker option is out of sync, but without a definition of SGII vs. SAII it's a guessing game.
Thanks for any help,
Gary
[416 byte] By [GaryKratkin] at [2007-12-16]
# 1
wrote Has a name decoration spec been published for VC2005? I have an undefined external __imp_?_S_next_size@?$_Stl_prime@_N@priv@std@@SGII@Z which nearly matches __imp_?_S_next_size@?$_Stl_prime@_N@priv@std@@SAII@Z in an import lib. Presumably a major compiler or linker option is out of sync, but without a definition of SGII vs. SAII it's a guessing game. You can use APIs or the undname utility to undecorate names (you'll probably have to remove the __imp_ which is a prefix for import descriptors). In your case it's a calling convention mismatch. The first one is a __stdcall the second one a __cdecl. -hg
MVPUser at 2007-9-9 > top of Msdn Tech,Visual C++,Visual C++ Language...
# 2
Personally I prefer to use extern "C" for exports since C doesn't use name mangling. Compiler inspecific and much simpler.
RITZ at 2007-9-9 > top of Msdn Tech,Visual C++,Visual C++ Language...
# 3
Thank you, undname.exe is perfect.
GaryKratkin at 2007-9-9 > top of Msdn Tech,Visual C++,Visual C++ Language...