代码之家  ›  专栏  ›  技术社区  ›  BullyWiiPlaza

编译64位的Microsoft绕道

  •  3
  • BullyWiiPlaza  · 技术社区  · 6 年前

    这个 detours 一揽子索赔支持 64-bit 但我看不到编译的方法 64位 二进制文件:

    绕行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 命令无效。

    如果我用图书馆( lib.X86 文件夹)在我的 Visual Studio C++ 配置为生成 64位 DLL ,我得到相应的错误,但它不会生成:

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

    重新命名文件夹 库x86 lib.X64 也不起作用。

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

    2 回复  |  直到 6 年前
        1
  •  4
  •   BullyWiiPlaza    6 年前

    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-bit 二进制文件应该编译成功。

        2
  •  0
  •   JWWalker    5 年前

    在命令行中,您可以说

    set DETOURS_TARGET_PROCESSOR=X64
    

    然后做 nmake 命令。