MathuSum Mut
MathuSum Mut

Reputation: 2825

How to undecorate linker object names in Visual Studio?

To undecorate mangled C++ names that Visual Studio generates in compiled libraries, one can use undname.exe. However, I am having an issue identifying the unmangled names if the library cannot compile due to unresolved external symbols.

Example:

Error LNK2001 unresolved external symbol __imp_ldap_value_free_len libcurl.lib(ldap.obj)

When try to I undecorate that name, I get the following:

C:\Program Files (x86)\Microsoft Visual Studio 14.0>undname.exe __imp_ldap_value_free_len
Microsoft (R) C++ Name Undecorator
Copyright (C) Microsoft Corporation. All rights reserved.

Undecoration of :- "__imp_ldap_value_free_len"
is :- "__imp_ldap_value_free_len"

This shows that the linker uses a different mangling format for intermediary object files. How do I obtain the original method header?

Upvotes: 0

Views: 304

Answers (1)

SoronelHaetir
SoronelHaetir

Reputation: 15162

The important thing to realize about names of the form __imp_ldap_value_free_len is to drop the __imp_ prefix and figure out where the remaining symbol name comes from. And indeed there is a ldap_value_free_len in Wldap32.dll (you link against Wldap32.lib).

Upvotes: 1

Related Questions