解决Detours编译报错(在Win10+vs2015开发环境下)
2016-05-16 20:36
405 查看
<span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">1、首先去</span><a target=_blank href="http://research.microsoft.com/en-us/downloads/d36340fb-4d3c-4ddd-bf5b-1db25d03713d/default.aspx" style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">官网</a><span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">下载安装包DetoursExpress30.msi,点击安装</span>
express版本的特点:不能全局拦截,也不能源码级别拦截
3、编译
我这里使用Windows10和vs1015,
首先打开 所有应用-visual studio 2015-选择vs2015开发人员命令提示
进入DetoursExpress30的安装目录
cd D:\Software\DetourExpress30\src输入nmake进行编译,出现如下错误
D:\Software\DetourExpress30>nmake Microsoft (R) 程序维护实用工具 14.00.23026.0 版 版权所有 (C) Microsoft Corporation。 保留所有权利。 cd "D:\Software\DetourExpress30\src" Created ..\include Created ..\lib.X86 Created ..\bin.X86 Created obj.X86 cl /W4 /WX /Zi /MTd /Gy /Gm- /Zl /Od /DDETOURS_BITS=32 /DWIN32_LEAN_AND_MEAN /D_WIN32_WINNT=0x403 /Gs /DDETOURS_X86=1 /DDETOURS_32BIT=1 /D_X86_ /DDETOURS_OPTION_BITS=64 /Fd..\lib.X86\detours.pdb /Foobj.X86\detours.obj /c .\detours.cpp 用于 x86 的 Microsoft (R) C/C++ 优化编译器 19.00.23026 版 版权所有(C) Microsoft Corporation。保留所有权利。 detours.cpp C:\Program Files (x86)\Windows Kits\8.1\include\um\dbghelp.h(1544): error C2220: 警告被视为错误 - 没有生成“object”文件 C:\Program Files (x86)\Windows Kits\8.1\include\um\dbghelp.h(1544): warning C4091: “typedef ”: 没有声明变量时忽略“” 的左侧 C:\Program Files (x86)\Windows Kits\8.1\include\um\dbghelp.h(3190): warning C4091: “typedef ”: 没有声明变量时忽略“” 的左侧 .\detours.cpp(156): warning C4456: “pbNew”的声明隐藏了上一个本地声明 .\detours.cpp(156): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings .\detours.cpp(147): note: 参见“pbNew”的声明 .\detours.cpp(163): warning C4456: “pbNew”的声明隐藏了上一个本地声明 .\detours.cpp(163): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings .\detours.cpp(147): note: 参见“pbNew”的声明 .\detours.cpp(1263): warning C4456: “o”的声明隐藏了上一个本地声明 .\detours.cpp(1263): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings .\detours.cpp(1112): note: 参见“o”的声明 NMAKE : fatal error U1077: “"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.EXE"”: 返回代码“0x2” Stop. NMAKE : fatal error U1077: “"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe"”: 返回代码“0x2” Stop. D:\Software\DetourExpress30>①使用文档编辑器打开 D:\Software\DetourExpress30\src\Makefile文件,搜索找到下面一行
CFLAGS=/W4 /WX /Zi /MTd /Gy /Gm- /Zl /Od /DDETOURS_BITS=$(DETOURS_BITS)将这一句中的 /WX 删除,如下
CFLAGS=/W4 /Zi /MTd /Gy /Gm- /Zl /Od /DDETOURS_BITS=$(DETOURS_BITS)
②使用文档编辑器打开D:\Software\DetourExpress30\samples\common.mak 搜索找到下面一行
<pre name="code" class="plain">CFLAGS=/nologo /Zi $(CLIB) /Gm- /W4 /WX /Od /DDETOURS_BITS=$(DETOURS_BITS)
同样删除 /WX
CFLAGS=/nologo /Zi $(CLIB) /Gm- /W4 /Od /DDETOURS_BITS=$(DETOURS_BITS)
然后运行nmake
就会编译成功
打开D:\Software\DetourExpress30\lib.X86 已经生成detours.lib文件
相关文章推荐
- 打开即时通讯服务器openfire的大门
- bzoj4592 [Shoi2015]脑洞治疗仪
- Eclipse调试Bug的七种常用技巧
- Android studio常用快捷键
- 关于winform生成的exe无法打开等异常情况总结
- 第10、11周项目1-点、圆、圆柱类族的设计(3)
- Android studio 没有SDK location设置选项
- linux命令行过长翻页
- jsp中的四种传参方式
- 313. Super Ugly Number
- javascript基础-猜拳游戏
- Android LayoutInflater原理分析,带你一步步深入了解View(一)
- linux下动态网站维护基本命令小结
- 发现一个多国语言互译的非谷歌翻译网站
- uva11343 Isolated Segments
- 从Unity引擎过度到Unreal4引擎
- MFC笔记-小实例-分割窗口-源代码
- easyUi--Uploadify文件上传
- Java中equals和==的区别
- 计算几何