I'm trying to compile Detours per the instructions. I'd like to compile 32 bit versions of the library, since I plan to hook a 32-bit application. I've googled for answers but they seem to explain the obvious, like switch to 64-bit, but I intend on compiling for 32-bit.
I've used a mix following commands, trying to get it to work:
SET DETOURS_TARGET_PROCESSOR=X86
CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x86
CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat"
NMAKE
However this results in the following errors:
1) During VCVARSALL:
[ERROR:team_explorer.bat] Directory not found : "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer"
[vcvarsall.bat] Environment initialized for: 'x86'
2) During NMAKE
LIBCMT.lib(chkstk.obj) : fatal error LNK1112: module machine type 'x86' conflicts with target machine type 'x64'
As you can see, despite my best efforts, it is complaining about the target machine type.
I have also tried vcvarsall x64, paired with SET DETOURS_TARGET_PROCESSOR=X86. (Not sure if this is a valid test) This resulted in
iping_d.obj : error LNK2001: unresolved external symbol iping_ProxyFileInfo
Please help me understand what I am doing wrong.
When I choose DETOURS_TARGET_PROCESSOR=X64, it compiles successfully, but it creates a 64-bit lib which I cannot use in my 32bit dll.
I've also tried all this from the VC x86 Native Tools Command Prompt, with the same results.