"Unresolved external symbol __except_handler4_common" in Visual Studio 2015
The error message is actually saying the the function __except_handler4
, defined in MSVCRT.LIB, references the undefined symbol __except_handler4_common
. So it's not your code that's making the this reference, it's Visual Studio 2015's code.
The symbol __except_handler4_common
is defined in vcruntime.lib. This file should be automatically be linked in. I'm not sure why it wasn't. Did you select the static runtime library in the project options ("Multi-threaded (/MT)"), but then manually add MSVCRT.LIB (part of the dynamic C runtime libary)?
In your library project, check Properties -> C/C++ -> Code Generation -> Runtime Library
Chances are it's set to "Multi Threaded Debug DLL" (/MDd).
If that's the case then try changing it to "Multi Threaded Debug" (/MTd) and rebuild (that worked for me).