找回密码
 加入我们

QQ登录

只需一步,快速开始

搜索
查看: 7120|回复: 3

编译驱动出现错误,请各位帮忙看下!

[复制链接]

3

主题

7

回帖

1

精华

铂金会员

积分
2423
发表于 2013-9-12 01:52:12 | 显示全部楼层 |阅读模式
我是Windows 7 64位操作系统 开发环境为VS2008 +DKK
今天安装了一个ddkbuild
编译的时候出现

1>------ 已启动全部重新生成: 项目: Driver.W7, 配置: W7 checked (PREfast) Win32 ------
1>正在执行生成文件项目操作
1>OSR DDKBUILD.CMD V7.4/r60 (2009-11-28) - OSR, Open Systems Resources, Inc.
1>DDKBLD: ERROR #3: To build using type W7 you need to set the %W7BASE% environment variable to point to the Windows 7/Windows 2008 Server R2 DDK base directory!
1>USAGE:
1>======
1>  ddkbuild <target> <build type> <directory> [flags] [-WDF] [-PREFAST] [-CUV]
1>Values for <target>:
1>   ---------------------------------------------------------------------------
1>    Target OS version and architecture  | Miscellaneous
1>   -------------------------------------|-------------------------------------
1>    <target>    | Windows     | CPU     | Base directory | <target> alias(es)
1>   -------------|-------------|---------|----------------|--------------------
1>    -NT4        | NT 4.0      | x86     | %NT4BASE%      |
1>    -W2K        | 2000        | x86     | %W2KBASE%      |
1>    -W2K64      | 2000        | Itanium | %W2KBASE%      | -W2KI64
1>    -WXP        | XP          | x86     | %WXPBASE%      | -XP
1>    -WXP64      | XP          | Itanium | %WXPBASE%      | -WXPI64, -XP64
1>    -WXP2K      | 2000        | x86     | %WXPBASE%      | -XPW2K
1>    -WNET       | 2003        | x86     | %WNETBASE%     |
1>    -WNET64     | 2003        | Itanium | %WNETBASE%     | -WNETI64
1>    -WNETXP     | XP          | x86     | %WNETBASE%     |
1>    -WNETXP64   | XP          | Itanium | %WNETBASE%     |
1>    -WNETAMD64  | 2003/XP x64 | x64     | %WNETBASE%     | -WNETX64, -WNETA64
1>    -WNET2K     | 2000 SP3    | x86     | %WNETBASE%     | -WNETW2K
1>    -WLH        | Vista/2008  | x86     | %WLHBASE%      |
1>    -WLH2K      | 2000 SP4    | x86     | %WLHBASE%      |
1>    -WLHXP      | XP          | x86     | %WLHBASE%      |
1>    -WLHXP64    | XP          | Itanium | %WLHBASE%      |
1>    -WLHNET     | 2003        | x86     | %WLHBASE%      |
1>    -WLHNETI64  | 2003        | Itanium | %WLHBASE%      | -WLHNET64
1>    -WLHNETX64  | 2003/XP x64 | x64     | %WLHBASE%      | -WLHNETA64
1>    -WLHI64     | Vista/2008  | Itanium | %WLHBASE%      | -WLH64
1>    -WLHX64     | Vista/2008  | x64     | %WLHBASE%      | -WLHA64
1>    -W7         | 7/2008 R2   | x86     | %W7BASE%       | -WIN7
1>    -W7I64      | 7/2008 R2   | Itanium | %W7BASE%       | -WIN764
1>    -W7X64      | 7/2008 R2   | x64     | %W7BASE%       | -WIN7A64
1>    -W7LH       | Vista/2008  | x86     | %W7BASE%       | -WIN7WLH
1>    -W7LHI64    | Vista/2008  | Itanium | %W7BASE%       | -WIN7WLH64
1>    -W7LHX64    | Vista/2008  | x64     | %W7BASE%       | -WIN7WLHA64
1>    -W7NET      | 2003        | x86     | %W7BASE%       | -WIN7NET
1>    -W7NETI64   | 2003        | Itanium | %W7BASE%       | -WIN7NET64
1>    -W7NETX64   | 2003/XP x64 | x64     | %W7BASE%       | -WIN7NETA64
1>    -W7XP       | XP          | x86     | %W7BASE%       | -WIN7XP
1>   ---------------------------------------------------------------------------
1>    Support for NT4 and W2K DDKs is deprecated and not checked anymore
1>    in new versions. It may or may not work properly.
1>   ---------------------------------------------------------------------------
1>Values for <build type>:
1>      checked, chk     indicates a checked build
1>      free, fre        indicates a free build
1>Remaining parameters (all optional):
1>      <directory>      path to build directory, try . (current directory)
1>      [flags]          any flags you think should be passed to build (try /a
1>                       for clean)
1>      -WDF             performs a WDF build
1>      -PREFAST         performs a PREFAST build
1>      -CUV             uses the Call Usage Verifier, implies a PREFAST build
1>Special files:
1>      The build target directory (where the DIRS or SOURCES file resides) can
1>      contain the following files:
1>      - ddkprebld.cmd
1>        Allows to include a step before the BUILD tool from the DDK is called
1>        but after the environment for the respective DDK has been set!
1>      - ddkpostbld.cmd
1>        Allows to include a step after the BUILD tool from the DDK is called,
1>        so the environment is still available to the script.
1>      - ddkbldenv.cmd
1>        Allows to set (or override) _any_ environment variables that may exist
1>        in the global environment. Thus you can set the base directory for the
1>        DDK from inside this script, making your project more self-contained.
1>      DDKBUILD will only handle those files which exist, so you may choose to
1>      use none, one or multiple of these script files.
1>      (All scripts execute inside their current directory. Consider this!)
1>Examples:
1>      "ddkbuild -NT4 checked ." (for NT4 BUILD)
1>      "ddkbuild -WXP64 chk ."
1>      "ddkbuild -WXP chk c:\projects\myproject"
1>      "ddkbuild -WNET64 chk ."      (IA64 build)
1>      "ddkbuild -WNETAMD64 chk ."   (AMD64/EM64T build)
1>      "ddkbuild -WNETXP chk . -cZ -WDF"
1>      "ddkbuild -WNETXP chk . -cZ -PREFAST"
1>      In order for this procedure to work correctly for each platform, it
1>      requires an environment variable to be set up for certain platforms.
1>      There is an auto-detection mechanism in this script, which will work best
1>      if the DDK/WDK was installed using the normal installer (i.e. not just
1>      copied). The auto-detection is based on the DDK/WDK for which you request
1>      a build. Whenever you set the variable explicitly, this will take
1>      precedence over the auto-detected path!
1>      The environment variables are as follows:
1>      %NT4BASE%  - Set this up for "-NT4" builds
1>      %W2KBASE%  - Set this up for "-W2K" and "-W2K64" builds
1>      %WXPBASE%  - Set this up for "-WXP", "-WXP64", "-WXP2K" builds
1>      %WNETBASE% - Set this up for "-WNET*" builds
1>      %WLHBASE%  - Set this up for "-WLH*" builds
1>      %W7BASE%   - Set this up for "-W7*" builds
1>      %WDF_ROOT% must be set if attempting to do a WDF Build previous to the
1>      Vista WDK (in later DDKs there is no need to set WDF_ROOT).
1>Path to this script:
1>     C:\WinDDK\ddkbuild.cmd
1>  OSR DDKBUILD.CMD V7.4/r60 (2009-11-28) - OSR, Open Systems Resources, Inc.
1>  -> report any problems to <info@osr.com> or <http://assarbad.net/contact/>
1>项目 : error PRJ0002 : 错误的结果 3 (从“C:\Windows\SysWow64\cmd.exe”返回)。
1>生成日志保存在“file://m:\项目源码\Driver\Driver\BuildLog.htm”
1>Driver.W7 - 1 个错误,0 个警告
========== 全部重新生成: 成功 0 个,失败 1 个,跳过 0 个 ==========


请问如何解决?

857

主题

2632

回帖

2

精华

管理员

此生无悔入华夏,  长居日耳曼尼亚。  

积分
36130
发表于 2013-9-12 09:45:52 | 显示全部楼层
编译X64驱动要用WDK。
打开WDK(WIN7 X64 FREE),切换到源码所在目录,然后输入BUILD就可以编译了。

3

主题

7

回帖

1

精华

铂金会员

积分
2423
 楼主| 发表于 2013-9-12 13:12:12 | 显示全部楼层
本帖最后由 vigny 于 2013-9-12 20:59 编辑

问题已经解决,设置下系统环境变量即可
如图
QQ截图20130912131039.jpg

还有编译成功无法获得生成出来的SYS文件的解决方法

在新建Driver Object的时候,不要选“create PREfast configuration”这个选项

评分

参与人数 1水晶币 +20 收起 理由
admin + 20 赞一个!

查看全部评分

857

主题

2632

回帖

2

精华

管理员

此生无悔入华夏,  长居日耳曼尼亚。  

积分
36130
发表于 2013-10-15 23:52:06 | 显示全部楼层
这一个月LZ进步很快。。。
您需要登录后才可以回帖 登录 | 加入我们

本版积分规则

快速回复 返回顶部 返回列表