c++ - 为 64 位编译 Microsoft Detours
问题描述
该detours
软件包声称支持64-bit
,但我没有看到编译64-bit
二进制文件的方法:
绕行 32 位和 64 位进程
使用nmake all
只编译32-bit
东西:
>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
命令无效。
如果我在我的项目中使用配置为生成 a的库(lib.X86
文件夹),我会收到相应的错误并且它不会构建:Visual Studio C++
64-bit
DLL
library machine type 'x86' conflicts with target machine type 'x64'
将文件夹重命名lib.X86
为lib.X64
也不起作用。
我怎样才能让它在64-bit
环境中工作还是不可能?
解决方案
看来您必须将目标处理器设置为 64 位,然后编译. 工作批处理 ( .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-bit
二进制文件应该可以成功编译。
推荐阅读
- java - 我无法在 Java 中设置永久路径
- javascript - 从另一个更改一个 Select2 的值会创建递归
- r - 使用 R,如何获取.seed()?
- html - 影响绝对定位元素的不透明度
- swift - 如何安全地解开函数中使用的实例变量?迅速
- c# - 当应用程序在 Xamarin WebView 中启动时,键盘会自动显示
- python - reFromat JSON 与 python 提取嵌套字典
- python - 在 Python 中获取字符串中的表情符号计数
- php - laravel 自定义包开发中中间件的使用
- r - 当我在ggplot2中使用汉字时从rmarkdown生成的奇怪符号