Visual Studio 2017 (fresh install- command line version) gives error:
LNK2019: unresolved external symbol Mhook_SetHook referenced in function wmain LNK2019: unresolved external symbol Mhook_UnHook referenced in function wmain
Compile command: cl /Y- /EHsc /DUNICODE mhook-test.cpp gdi32.lib user32.lib
I thought this might be related to C / C++ mixup, so I modified mhook.h as follows:
#ifdef __cplusplus
extern "C" {
#endif
BOOL Mhook_SetHook(PVOID *ppSystemFunction, PVOID pHookFunction);
BOOL Mhook_Unhook(PVOID *ppHookedFunction);
#ifdef __cplusplus
} // extern "C"
#endif
This did not make a difference in results.
I don't understand why the linker is having a problem.
mhook-test.cpp came with the mhook library.