【发布时间】:2015-01-10 10:50:53
【问题描述】:
我尝试使用以下命令为 WinXP x86 Release 编译驱动程序:
C:\WinDDK\7600.16385.0\bin\setenv.bat C:\WinDDK\7600.16385.0\ fre x86 WXP no_oacr
cd C:\src
build
由于有关 msvcrt_winxp.obj 的这些 U1073 错误,它失败了。我查了一下,C:\WinDDK 或其子目录中的任何地方都没有 msvcrt_winxp.obj 文件。
在我看来问题不在实际代码中,但也许我在编译之前没有设置 DDK。为什么会出现这些 U1073 错误?
我发现了这个类似的问题 - driver build is failing for amd64 via winddk,但是 OP 没有包含相关信息,例如他的构建输出,他的问题没有得到解答。我也找到了这个帖子 - http://www.techtalkz.com/microsoft-device-drivers/295015-wdk-linker-error-u1073.html,但那里也没有答案。
我的构建输出:
BUILD: Compile and Link for x86
BUILD: Loading c:\winddk\7600.16385.0\build.dat...
BUILD: Computing Include file dependencies:
BUILD: Start time: Thu Nov 13 12:04:25 2014
BUILD: Examining c:\src directory tree for files to compile.
c:\src
c:\src\common
c:\src\driver
c:\src\ui
BUILD: Saving c:\winddk\7600.16385.0\build.dat...
1>BUILD: Compiling (NoSync) c:\src\driver directory
2>BUILD: Compiling (NoSync) c:\src\ui directory
_NT_TARGET_VERSION SET TO WINXP
_NT_TARGET_VERSION SET TO WINXP
1>BUILD: Linking for c:\src\driver directory
2>BUILD: Linking for c:\src\ui directory
_NT_TARGET_VERSION SET TO WINXP
_NT_TARGET_VERSION SET TO WINXP
1>errors in directory c:\src\driver
1>NMAKE : fatal error U1073: don't know how to make 'c:\winddk\7600.16385.0\lib\wxp\i386\msvcrt_winxp.obj'
2>errors in directory c:\src\ui
2>NMAKE : fatal error U1073: don't know how to make 'c:\winddk\7600.16385.0\lib\wxp\i386\msvcrt_winxp.obj'
1>nmake.exe /nologo BUILDMSG=Stop. -i /nologo /f c:\winddk\7600.16385.0\bin\makefile.def BUILD_PASS=PASS2 LINKONLY=1 NOPASS0=1 MAKEDLL=1 MAKEDIR_RELATIVE_TO_BASEDIR= failed - rc = 2
2>nmake.exe /nologo BUILDMSG=Stop. -i /nologo /f c:\winddk\7600.16385.0\bin\makefile.def BUILD_PASS=PASS2 LINKONLY=1 NOPASS0=1 MAKEDLL=1 MAKEDIR_RELATIVE_TO_BASEDIR= failed - rc = 2
BUILD: Finish time: Thu Nov 13 12:04:26 2014
BUILD: Done
0 files compiled - 4 Errors
【问题讨论】:
-
WDK 版本 7600 于 2010 年发布,它针对 Windows 7 和 Server 2008。这与“这是一个旧项目”和针对 XP 的情况不太吻合,您肯定需要使用原始程序员用来避免生成文件错误的 WDK 版本。不管那可能是什么,你都不会留下面包屑。 Fwiw,构建 msvcrt.dll 只能由 Microsoft 机器完成。
-
好的,
7600.16385.0版本确实支持 WinXP,如果不支持,这行C:\WinDDK\7600.16385.0\bin\setenv.bat C:\WinDDK\7600.16385.0\ fre x86 WXP no_oacr将失败。其实我刚查了一下,如果我把WXP换成WXP2就不行了。所以支持XP。还有,我是老程序员了,但我接触它是三年前的事了,所以是的,它也可能是其他人。
标签: c++ build-error wdk