2

Microsoft の Detours ライブラリを使用しており、32 ビット バージョン (無料) を使用していました。現在、Windows 7 の 64 ビット インストールを使用していますが、nmake で Detours をコンパイルできないようです。

エラーは次のとおりです。

Microsoft (R) Program Maintenance Utility Version 9.00.21022.08
Copyright (C) Microsoft Corporation.  All rights reserved.

        cd "C:\Program Files (x86)\Microsoft Research\Detours Express 2.1\src"
Building for 64-bit X64.
        if not exist "..\include" mkdir "..\include"
        if not exist "..\lib" mkdir "..\lib"
        if not exist "..\bin" mkdir "..\bin"
        cl /LD /nologo /W4 /WX /Zi /MTd /Gy /Gm- /Zl /O1 /DWIN32_LEAN_AND_MEAN /
D_WIN32_WINNT=0x403 /D_WIN64 /DDETOURS_X64=1 /D_AMD64_ /Wp64 /Fe..\bin\detoured.
dll /Fd..\bin\detoured.pdb detoured.cpp  /link /release /machine:amd64 /base:0xf
000000 /incremental:no /subsystem:console  /entry:DllMain /implib:..\lib\detoure
d.lib  /export:Detoured kernel32.lib detoured.res
cl : Command line warning D9035 : option 'Wp64' has been deprecated and will be
removed in a future release
detoured.cpp
c:\program files (x86)\microsoft visual studio 9.0\vc\include\codeanalysis\sourc
eannotations.h(17) : error C2371: 'size_t' : redefinition; different basic types

        detoured.cpp : see declaration of 'size_t'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\basetsd.h(305) : warning C
4311: 'type cast' : pointer truncation from 'const void *' to 'unsigned long'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\basetsd.h(314) : warning C
4311: 'type cast' : pointer truncation from 'const void *' to 'long'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\basetsd.h(323) : warning C
4312: 'type cast' : conversion from 'unsigned long' to 'void *' of greater size
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winnt.h(12935) : error C38
61: '__readfsdword': identifier not found
NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio 9.0\
VC\BIN\cl.EXE"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio 9.0\
VC\BIN\nmake.exe"' : return code '0x2'
Stop.

ご覧のとおり、64 ビット用にコンパイルしようとしています。nmake を強制的に 32 ビット用にビルドするにはどうすればよいですか?

ありがとう、デイブ

4

2 に答える 2

3

次回は、DETOURS_TARGET_PROCESSOR 環境変数を設定するだけです。有効な値は x86、AMD64、および IA64 です。(Detours の Express バージョンは x86 のみをサポートします。)

于 2010-11-21T20:19:40.750 に答える
2

コンパイルするにはWindows SDKが必要でした。Windows SDK を Google で検索し、ダウンロードしてインストールし、Windows SDK コンソールを管理者モードで実行してコンパイルするだけです。

Windows 7 に SDK をインストールするとエラーが発生する場合は、次の方法で解決できます。

http://support.microsoft.com/kb/2717426/de

この問題は、新しいバージョンの Visual C++ 2010 再頒布可能パッケージがインストールされているコンピューターに Windows 7 SDK をインストールすると発生します。Windows 7 SDK は、Visual C++ 2010 再頒布可能パッケージのバージョン 10.0.30319 をインストールします。

この問題を解決するには、Windows 7 SDK をインストールする前に、Visual C++ 2010 再頒布可能パッケージのすべてのバージョンをアンインストールする必要があります。次の製品が 1 つ以上インストールされている可能性があります。

  • Microsoft Visual C++ 2010 x86 再頒布可能パッケージ
  • Microsoft Visual C++ 2010 x64 再頒布可能パッケージ
于 2010-09-24T14:16:19.350 に答える