【问题标题】:How to Configure Visual Studio 2008 for Compiling Drivers?如何配置 Visual Studio 2008 以编译驱动程序?
【发布时间】:2013-09-29 16:02:22
【问题描述】:

我配置了 Visual Studio 2008 来编译驱动程序,但仍然显示 ctype.h 和 excpt.h 的头文件有很多语法错误

【问题讨论】:

  • 有关通用计算硬件和软件的问题对于 Stack Overflow 来说是题外话,除非它们直接涉及主要用于编程的工具。您或许能够获得有关超级用户的帮助。
  • 我已经使用检查的构建环境生成了 .sys 文件,但没有设置通过 Visual Studio 2008 生成 .sys 文件,所以只是想要一些指导,但我想通了,并发布了这个希望的答案它肯定会帮助一些初学者进行 Windows 设备驱动程序开发..

标签: windows visual-studio-2008 configure drivers


【解决方案1】:
I configured with following settings :

Setup Visual Studio 2008.

    Setup ddk (wdk).

    Add to Visual Studio paths DDK include files, libs and bins, In VS goto tools ->options->Project and solutions->VC++ directories-> add path to your ddk Include files,Executeable file,Library file 

    Create new empty "Win32 project" and add source file (i.e. Hello_World.c).

    Configure project properties (All Configurations):

    C\C++ - General - Debug Information Format = Program Database (/Zi)
    C\C++ - Optimization - Disabled
    C\C++ - Preprocessor - Preprocessor Definitions = _X86_;_DEBUG;DBG
    C\C++ - Code Generation - Enable Minimum Rebuild = Yes(/Gm)
    C\C++ - Code Generation - Enable C++ Exceptions = No
    C\C++ - Code Generation - Basic Runtime Checks = Default
    C\C++ - Code Generation - Buffer Security Check = No (/GS-)
    C\C++ - Advanced - Calling Convention = __stdcall (/Gz)
    C\C++ - Advanced - Compile As = Compile as C Code (/TC) [if you are going to use plain   
    C\C++ - Command Line - it must show /Od /D "_X86_" /D "_DEBUG" /D "DBG" /D "_MBCS" /Gm /MDd /GS- /Fo"Debug\\" /Fd"Debug\vc90.pdb" /W3 /nologo /c /Zi /Gz /TC /showIncludes /errorReport:prompt                                                         C]
    Linker - General - Output File = $(OutDir)\$(ProjectName).sys
    Linker - General - Enable Incremental Linking = Default
    Linker - Input - Additional Dependencies = ntoskrnl.lib hal.lib $(NOINHERIT) [add     
                                               needed libs here e.g. ntoskrnl.lib hal.lib]
    Linker - Input - Ignore All Default Libraries = Yes (/NODEFAULTLIB)
    Linker - Manifest File - Generate Manifest = No
    Linker - System - Sub System = Native (/SUBSYSTEM:NATIVE)
    Linker - System - Driver = Driver (/DRIVER)
    Linker - Advanced - Entry Point = DriverEntry
    Linker - Advanced - Base Address = 0x10000
    Linker - Advanced - Randomized Base Address = Default
    Linker - Advanced - Data Execution Prevention (DEP) = Default

现在使用当前设置为您的驱动程序代码构建解决方案..

【讨论】:

    【解决方案2】:

    检查是否已将 Visual Studio 头文件、库文件、可执行文件路径正确添加到 DDK 目录..

    【讨论】:

      猜你喜欢
      • 2014-08-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-07
      • 1970-01-01
      • 2011-04-15
      • 1970-01-01
      相关资源
      最近更新 更多