当前位置: 代码迷 >> 驱动开发 >> ,刚刚好像发错地方去了晕,驱动编程的2个error 是很简单的那种小弟我刚刚开始学的,新人可以一起交流
  详细解决方案

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

热度:233   发布时间:2016-04-28 10:58:57.0
求助,刚刚好像发错地方去了晕,驱动编程的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;
}

你在哪发的我都看到了!呵呵
  相关解决方案