Tall Software Dude
Tall Software Dude

Reputation: 688

How to resolve an unresolved external symbol error with MSVCRTD.lib

I have a C++ Visual Studio DLL project that has a link error:

MSVCRTD.lib(tncleanup.obj) : error LNK2019: unresolved external symbol __imp__InitializeSListHead@4 referenced in function "void __cdecl __scrt_initialize_type_info(void)" (?__scrt_initialize_type_info@@YAXXZ)

I set the Project Properties, Linker, General, Show Progress to "For Libraries Searched" to verify the correct version of MSVCRTD.lib is being referenced.

Upvotes: 0

Views: 2397

Answers (1)

Tall Software Dude
Tall Software Dude

Reputation: 688

  1. Look up the unresolved external symbol: InitializeSListHead to find what library it is defined in:

https://msdn.microsoft.com/en-us/library/windows/desktop/ms683482(v=vs.85).aspx

Kernel32.lib

  1. In Visual Studio, set the Project Properties, Linker, General, Show Progress to “For Libraries Searched (/VERBOSE:Lib)"

  2. Start a build and examine the output to see the "Searching libraries" referencing "Kernel32.lib".

In my case I found another Kernel32.lib was being referenced incorrectly.

Upvotes: 0

Related Questions