首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 嵌入开发 > 驱动开发 >

,刚刚好像发错地方去了晕,驱动编程的2个error 是很简单的那种小弟我刚刚开始学的,新人可以一起交流

2012-03-29 
求助,刚刚好像发错地方去了晕,驱动编程的2个error是很简单的那种我刚刚开始学的,新人可以一起交流errors i

求助,刚刚好像发错地方去了晕,驱动编程的2个error 是很简单的那种我刚刚开始学的,新人可以一起交流
errors in directory c:\test
NMAKE : fatal error U1002: syntax error :invalid macro invocation '$'
nmake.exe / nologo BUILDMSG=Stop . -i BUILD_PASS=PASS2 LINKONLY=1 NOPASS0=1 MAKEDIR_RELATIVE_TO_BASEDIR= failed - rc = 2

这里的错误是什么啊?


#include <ntddk.h>

VOID DriverUnload(PDRIVER_OBJECT driver)
{
  DbgPrint("first:Our driver is unloading...\r\n");
}


NTSTATUS DriverEntry(PDRIVER_OBJECT driver, PUNICODE_STRING reg_path)
{
  DbgPrint("first:hello,my salary!");
  dirver -> DriverUnload = DriverUnload;
  return STATUS_SUCCESS;
}

这个是.c文件


TARGETNAME=first
TARGETTYPE=DRIVER
TARGETPATH=obj
SOURCES=first.c  
这个是sources 文件


#
#DO NOT EDIT THIS FILE!!! EDIT .\sources. if you want to add a new source
#file to this component . This file marely indirects to the real make file 
#that is shared by all the components of NT OS/2
#
! INCLUDE $ <NTMAKEENV> \makefile.def

makefile 文件

[解决办法]
建议用vc的环境开发,可以使用va插件,自己在vc的环境下添加include文件就有va的提示了,你那driver变量都写错了!

sources

TARGETNAME=first
TARGETTYPE=DRIVER
TARGETPATH=obj
SOURCES=test.c

makefile

#
#DO NOT EDIT THIS FILE!!! EDIT .\sources. if you want to add a new source
#file to this component . This file marely indirects to the real make file
#that is shared by all the components of NT OS/2
#
!INCLUDE $(NTMAKEENV)\makefile.def

test.c

#include <ntddk.h>

VOID DriverUnload(PDRIVER_OBJECT driver)
{
DbgPrint("first:Our driver is unloading...\r\n");
}


NTSTATUS DriverEntry(PDRIVER_OBJECT driver, PUNICODE_STRING reg_path)
{
DbgPrint("first:hello,my salary!");
driver -> DriverUnload = DriverUnload;
return STATUS_SUCCESS;
}

你在哪发的我都看到了!呵呵

热点排行