1.先前往github进行源码的下载
Release Version 4.0.1 of Detours · microsoft/Detours · GitHub
https://github.com/microsoft/Detours/releases/tag/v4.0.12.将下载好的源码进行解压

3.找到Makefile的编译工具,我使用的是VS2022,则在开始菜单中找到VS2022

编译32位版本使用x86 Native Tools Command Prompt for VS 2022
编译64位版本则使用x64 Native Tools Command Prompt for VS 2022
4.进入对应的解压目录

5.开始使用nmake /f makefile 进行编译

6.编译完成

编译途中遇到过C2065编译错误
D:\project\test\Hook\Detours-4.0.1\samples\traceapi\_win32.cpp(4323):
error C2065: “GetThreadLocale”: 未声明的标识符
D:\project\test\Hook\Detours-4.0.1\samples\traceapi\_win32.cpp(7050):
error C2065: “SetThreadLocale”: 未声明的标识符
查询各方 将CFLAGS的/WX去除或增加windows.h头文件也无法解决
只能将对应GetThreadLocale和SetThreadLocale函数调用到的地方进行屏蔽


屏蔽后顺利编译通过
但是不知道对后续使用有什么影响


4998

被折叠的 条评论
为什么被折叠?



