VS2017 support

c++ / delphi package - dll injection and api hooking
Post Reply
_NN_
Posts: 55
Joined: Mon Jan 21, 2013 4:00 pm

VS2017 support

Post by _NN_ »

When I link madCHook64mt.lib in VS2017 I get the following errors:
1>madCHook64mt.lib(ObjectTools.obj) : error LNK2001: unresolved external symbol vsprintf_s
1>madCHook64mt.lib(DriverInject.obj) : error LNK2001: unresolved external symbol vsprintf_s
1>madCHook64mt.lib(SString.obj) : error LNK2001: unresolved external symbol vswprintf_s
I suppose there should be a special build with VS2017 in additional to the provided.
_NN_
Posts: 55
Joined: Mon Jan 21, 2013 4:00 pm

Re: VS2017 support

Post by _NN_ »

I have made some workaround by making dummy function calling these functions:

Code: Select all

#include <stdio.h>
void workaroundMadCHook()
{
	char cc[100];
	sprintf_s(cc, "a");

	wchar_t c[100];
	swprintf_s(c, L"a");

}
That way compiler to generate the inline functions and makes linker happy.
_NN_
Posts: 55
Joined: Mon Jan 21, 2013 4:00 pm

Re: VS2017 support

Post by _NN_ »

As pointed here: viewtopic.php?f=7&t=28164 adding library legacy_stdio_definitions.lib solves the problem.
Post Reply