c++ - 为 64 位编译 Microsoft Detours

标签 c++ windows visual-studio detours

detours包声称支持 64 位 但我没有看到编译 64 位 二进制文件的方法:

Detouring 32-bit and 64-bit Processes

使用nmake all 只编译32 位 东西:

>dir
 Volume in drive D is Volume
 Volume Serial Number is XXXX-XXXX

 Directory of D:\Detours

06/21/2018  03:46 PM    <DIR>          .
06/21/2018  03:46 PM    <DIR>          ..
06/23/2018  08:13 PM    <DIR>          bin.X86
06/20/2017  09:03 AM             5,105 CREDITS.TXT
06/22/2017  03:06 PM                31 Detours Version 3.0 Build_343
10/19/2016  12:06 PM           113,685 Detours.chm
06/23/2018  08:12 PM    <DIR>          include
06/23/2018  08:12 PM    <DIR>          lib.X86
10/29/2015  02:19 PM             7,144 LICENSE.RTF
12/21/2016  01:22 PM             1,851 Makefile
06/22/2017  03:06 PM            14,961 README.TXT
06/21/2018  03:04 PM    <DIR>          samples
06/23/2018  08:12 PM    <DIR>          src
10/29/2015  02:19 PM             4,841 system.mak
06/22/2017  03:06 PM                31 VERSION.TXT

nmake size64 命令无效。

如果我在我的 Visual Studio C++ 项目中使用库(lib.X86 文件夹),该项目配置为生成 64 位 DLL,我得到相应的错误并且无法构建:

library machine type 'x86' conflicts with target machine type 'x64'

将文件夹 lib.X86 重命名为 lib.X64 也不起作用。

我怎样才能让它在 64 位 环境中工作,还是不可能?

最佳答案

It seems like you have to set the target processor to 64-bit and then compile .工作批处理 (.bat) 脚本可能类似于以下内容(取决于您的 Visual Studio 安装):

SET DETOURS_TARGET_PROCESSOR=X64
CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
NMAKE

这样,64 位 二进制文件应该可以成功编译。

关于c++ - 为 64 位编译 Microsoft Detours,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51004020/

相关文章:

arrays - 设置多维数组批处理

c++ - 构建垂直的 IE 资源管理器栏(带​​对象)(如收藏夹面板)

.net - .NET 中是否有文件扩展名分隔符常量?

c# - Visual Studio dll 创建故障排除

c++ - 互斥锁映射c++11

c++ - 将 char[] 类型转换为结构并检索结构的值。?

c++ - 如何从压缩图像文件中打开某些区域而不将完整图像文件加载到内存中?

c++ - 当函数返回由模板类型和另一个类型组成的类型时,模板参数推导

visual-studio - Visual Studio 更新 (16.8.1) 导致 CI​​ 构建失败

c++ - First Boost 计划