1
我配置了Visual Studio 2008的編譯驅動程序,但仍顯示出大量的語法錯誤的頭文件ctype.h中和excpt.h如何配置Visual Studio 2008以編譯驅動程序?
我配置了Visual Studio 2008的編譯驅動程序,但仍顯示出大量的語法錯誤的頭文件ctype.h中和excpt.h如何配置Visual Studio 2008以編譯驅動程序?
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
現在構建的解決方案與當前設置你的驅動程序代碼..
檢查您是否已正確添加Visual Studio頭文件,庫文件,可執行文件路徑到DDK目錄..
有關通用計算硬件和軟件的問題與Stack Overflow相關,除非它們直接涉及主要用於編程的工具。您可以在超級用戶上獲得幫助。 – dhein
我已經使用checked build環境生成了.sys文件,但沒有設置通過visual studio 2008生成.sys文件,所以只是想要一些指導,但我想通了,也發佈了答案,希望它肯定會幫助一些初學者windows設備驅動程序開發 –