ddk 和wdk除了能开发windows驱动外,还可以作为应用程序开发的平台。以下是如何使用ddk和wdk编译应用程序的环境设置:
1、安装ddk/wdk;
2、准备makefile,这个文件内容比较固定,一般是以下的内容:
!IF 0
Copyright (C) Microsoft Corporation, 1999 - 2002
Module Name:
makefile.
Notes:
DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source
file to this component. This file merely indirects to the real make file
that is shared by all the components of Windows NT (DDK)
!ENDIF
!INCLUDE $(NTMAKEENV)\makefile.def
3、准备source文件,文件内容一般为:
TARGETNAME=自定义程序名
TARGETPATH=obj
TARGETTYPE=PROGRAM
USE_MAPSYM=1
USE_CRTDLL=1
UMTYPE=console /windows //如果是命令行程序设置为console,gui程序则为windows
TARGETLIBS=需要的库文件
C_DEFINES=$(C_DEFINES) -DUNICODE -D_UNICODE
SOURCES=xxxxxxxx.c \
xxxxxxxxxx.rc \
4、在ddk/wdk编译环境下,切换到你保存源代码的目录,build一下,如果代码无误,就能编译出你的exe文件了。
1、安装ddk/wdk;
2、准备makefile,这个文件内容比较固定,一般是以下的内容:
!IF 0
Copyright (C) Microsoft Corporation, 1999 - 2002
Module Name:
makefile.
Notes:
DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source
file to this component. This file merely indirects to the real make file
that is shared by all the components of Windows NT (DDK)
!ENDIF
!INCLUDE $(NTMAKEENV)\makefile.def
3、准备source文件,文件内容一般为:
TARGETNAME=自定义程序名
TARGETPATH=obj
TARGETTYPE=PROGRAM
USE_MAPSYM=1
USE_CRTDLL=1
UMTYPE=console /windows //如果是命令行程序设置为console,gui程序则为windows
TARGETLIBS=需要的库文件
C_DEFINES=$(C_DEFINES) -DUNICODE -D_UNICODE
SOURCES=xxxxxxxx.c \
xxxxxxxxxx.rc \
4、在ddk/wdk编译环境下,切换到你保存源代码的目录,build一下,如果代码无误,就能编译出你的exe文件了。