20楼#
发布于:2005-05-12 10:27
将工程中的ntdef.h从工程中删掉,我又删去了ndis.h,让它用DDK中的ndis.h 给你传个DS也没用 仔细看了一下,KeTickCount是由ntoskrnl输出的全局变量,里面有根据各个平台的条件编译。 类似这样 #if defined(_X86_) _DECL_HAL_KE_IMPORT VOID FASTCALL KfLowerIrql ( IN KIRQL NewIrql ); _DECL_HAL_KE_IMPORT KIRQL FASTCALL KfRaiseIrql ( IN KIRQL NewIrql ); #define KeLowerIrql(a) KfLowerIrql(a) #define KeRaiseIrql(a,b) *(b) = KfRaiseIrql(a) #elif defined(_ALPHA_) #define KeLowerIrql(a) __swpirql(a) #define KeRaiseIrql(a,b) *(b) = __swpirql(a) #elif defined(_IA64_) VOID KeLowerIrql ( IN KIRQL NewIrql ); VOID KeRaiseIrql ( IN KIRQL NewIrql, OUT PKIRQL OldIrql ); #elif defined(_AMD64_) // // These function are defined in amd64.h for the AMD64 platform. // #else #error \"no target architecture\" #endif 你可以在你的工程预定义处加 #ifndef _X86_ #define _X86_ 这就是你的出错信息的精确来源 很奇怪,为什么你那里会把工程转的丢了这个 看一下你的工程中的属性C/C++->Preprocessor中 Preprocessor Definitions中有没有_X86_=1; 这已经是最精确的解释了 |
|
|
21楼#
发布于:2005-05-12 12:00
等我把程序调试出来了,一定给大家加分!!!
我把我仅有的86分全部加给大家!! 谢了^_^ :D |
|
22楼#
发布于:2005-05-12 13:24
使用VC内嵌的driverstudio->build with build.exe编译
|
|
|
23楼#
发布于:2005-05-12 15:25
使用VC内嵌的driverstudio->build with build.exe编译 看他的出错信息Target architecture not defined 可以肯定是我上面说的问题 |
|
|
24楼#
发布于:2005-05-12 18:58
这是用VC内嵌的driverstudio->build with build.exe编译出来的结果:
(能产生.sys文件,但是里面还是有错误,用VC编译的时候仍然不行) Current DDK Directory = C:\\NTDDK Building for i386 ******Configuration: 8139 - Win32 Debug ************* Invalid keyboard code specified New or updated MSVC detected. Updating DDK environment.... Setting environment for using Microsoft Visual C++ tools. Starting dirs creation...Completed. The system cannot find the path specified. BUILD: Object root set to: ==> objchk BUILD: /i switch ignored BUILD: Compile and Link for i386 BUILD: Loading C:\\NTDDK\\build.dat... BUILD: Computing Include file dependencies: BUILD: c:\\progra~1\\micros~3\\vc98\\include\\exdisp.odl(31): c:\\progra~1\\micros~3\\vc98\\include\\exdisp.odl - invalid include statement: importlib(STDOLE_TLB); BUILD: c:\\progra~1\\micros~3\\vc98\\include\\vidsvr.odl(16): c:\\progra~1\\micros~3\\vc98\\include\\vidsvr.odl - invalid include statement: importlib(STDOLE_TLB); BUILD: Examining d:\\毕业设计\\200404~1\\8139 directory for files to compile. d:\\毕业设计\\200404~1\\8139 d:\\毕业设计\\200404~1\\8139 - 2 source files (1,805 lines) BUILD: Saving C:\\NTDDK\\build.dat... BUILD: Compiling d:\\毕业设计\\200404~1\\8139 directory Compiling - driver.c for i386 Compiling - ioctrl.c for i386 BUILD: Linking d:\\毕业设计\\200404~1\\8139 directory Linking Executable - objchk\\i386\\r8139.sys for i386 BUILD: Done 2 files compiled - 1805 LPS 1 executable built Tool returned code: 0 |
|
25楼#
发布于:2005-05-13 08:39
直接用DDK 编译环境
build -cz得了 |
|
|
26楼#
发布于:2005-05-13 08:44
这是用VC内嵌的driverstudio->build with build.exe编译出来的结果: 你的这个毛病,以前讨论过多次,以后记住,路径名不能用中文. 你那个d:\\毕业设计\\是罪魁祸首.把你的毕业设计枪毙,一切OK |
|
|
27楼#
发布于:2005-05-13 12:06
我先把分加给大家吧!
不过,本人可用分数实在是太少了只有,20多了!抱歉,每个人只能少加点了^_^ |
|
28楼#
发布于:2005-05-13 17:03
在工程预定义处已经加入了_x86_=1
现在编译可以通过,但是link的时候还是出现了问题! 已经把路径改了,路径里面不包含中文了! 用VC内嵌的driverstudio build的结果都在下面,还是请各位高手帮忙! 谢谢了^_^ --------------------Configuration: 8139 - Win32 Debug-------------------- Compiling... driver.c d:\\rtl8139\\8139\\driver.c(121) : warning C4101: \'ConfigurationHandle\' : unreferenced local variable d:\\rtl8139\\8139\\driver.c(304) : warning C4101: \'i\' : unreferenced local variable d:\\rtl8139\\8139\\driver.c(351) : warning C4101: \'i\' : unreferenced local variable d:\\rtl8139\\8139\\driver.c(679) : warning C4101: \'tmpTSD\' : unreferenced local variable d:\\rtl8139\\8139\\driver.c(780) : warning C4101: \'Tmp\' : unreferenced local variable d:\\rtl8139\\8139\\driver.c(781) : warning C4101: \'cmd\' : unreferenced local variable d:\\rtl8139\\8139\\driver.c(815) : warning C4101: \'Tmplong\' : unreferenced local variable d:\\rtl8139\\8139\\driver.c(816) : warning C4101: \'cur_rx\' : unreferenced local variable d:\\rtl8139\\8139\\driver.c(817) : warning C4101: \'link_changed\' : unreferenced local variable d:\\rtl8139\\8139\\driver.c(814) : warning C4101: \'TmpTCR\' : unreferenced local variable d:\\rtl8139\\8139\\driver.c(860) : warning C4101: \'i\' : unreferenced local variable d:\\rtl8139\\8139\\driver.c(991) : warning C4101: \'TmpShort\' : unreferenced local variable d:\\rtl8139\\8139\\driver.c(989) : warning C4101: \'Tmplong\' : unreferenced local variable d:\\rtl8139\\8139\\driver.c(990) : warning C4101: \'i\' : unreferenced local variable d:\\rtl8139\\8139\\driver.c(988) : warning C4101: \'TmpCM\' : unreferenced local variable d:\\rtl8139\\8139\\driver.c(1040) : warning C4101: \'VirtualAddress\' : unreferenced local variable d:\\rtl8139\\8139\\driver.c(1042) : warning C4101: \'phy\' : unreferenced local variable d:\\rtl8139\\8139\\driver.c(1035) : warning C4101: \'Addr\' : unreferenced local variable d:\\rtl8139\\8139\\driver.c(1036) : warning C4101: \'bufsize\' : unreferenced local variable d:\\rtl8139\\8139\\driver.c(1197) : warning C4101: \'buf\' : unreferenced local variable d:\\rtl8139\\8139\\driver.c(1198) : warning C4101: \'buf_desc\' : unreferenced local variable d:\\rtl8139\\8139\\driver.c(1195) : warning C4101: \'Status\' : unreferenced local variable d:\\rtl8139\\8139\\driver.c(1194) : warning C4101: \'i\' : unreferenced local variable d:\\rtl8139\\8139\\driver.c(1199) : warning C4101: \'buf_len\' : unreferenced local variable d:\\rtl8139\\8139\\driver.c(1244) : warning C4101: \'buf\' : unreferenced local variable d:\\rtl8139\\8139\\driver.c(1246) : warning C4101: \'buf_desc\' : unreferenced local variable d:\\rtl8139\\8139\\driver.c(1239) : warning C4101: \'Status\' : unreferenced local variable d:\\rtl8139\\8139\\driver.c(1248) : warning C4101: \'i\' : unreferenced local variable d:\\rtl8139\\8139\\driver.c(1331) : warning C4101: \'TmpCM\' : unreferenced local variable ioctrl.c d:\\rtl8139\\8139\\ioctrl.c(188) : warning C4101: \'status\' : unreferenced local variable Linking... driver.obj : error LNK2001: unresolved external symbol __imp__NdisTerminateWrapper driver.obj : error LNK2001: unresolved external symbol __imp__NdisMRegisterMiniport driver.obj : error LNK2001: unresolved external symbol __imp__NdisInitializeWrapper driver.obj : error LNK2001: unresolved external symbol __imp__IoDeleteDevice ioctrl.obj : error LNK2001: unresolved external symbol __imp__IoDeleteDevice driver.obj : error LNK2001: unresolved external symbol __imp__IoCreateSymbolicLink driver.obj : error LNK2001: unresolved external symbol _DbgPrint driver.obj : error LNK2001: unresolved external symbol __imp__IoCreateDevice driver.obj : error LNK2001: unresolved external symbol __imp__RtlInitUnicodeString@8 ioctrl.obj : error LNK2001: unresolved external symbol __imp__RtlInitUnicodeString@8 driver.obj : error LNK2001: unresolved external symbol __imp__NdisMAllocateMapRegisters driver.obj : error LNK2001: unresolved external symbol __imp__NdisMRegisterInterrupt driver.obj : error LNK2001: unresolved external symbol __imp__NdisMRegisterIoPortRange driver.obj : error LNK2001: unresolved external symbol __imp__NdisWritePciSlotInformation driver.obj : error LNK2001: unresolved external symbol __imp__NdisMSetAttributesEx driver.obj : error LNK2001: unresolved external symbol __imp__NdisMPciAssignResources driver.obj : error LNK2001: unresolved external symbol __imp__NdisReadPciSlotInformation driver.obj : error LNK2001: unresolved external symbol __imp__NdisAllocateMemoryWithTag driver.obj : error LNK2001: unresolved external symbol __imp__WRITE_PORT_ULONG driver.obj : error LNK2001: unresolved external symbol __imp__READ_PORT_UCHAR driver.obj : error LNK2001: unresolved external symbol __imp__NdisQueryBuffer driver.obj : error LNK2001: unresolved external symbol __imp__NDIS_BUFFER_TO_SPAN_PAGES driver.obj : error LNK2001: unresolved external symbol __imp__NdisQueryBufferOffset driver.obj : error LNK2001: unresolved external symbol __imp__WRITE_PORT_USHORT driver.obj : error LNK2001: unresolved external symbol __imp__READ_PORT_USHORT driver.obj : error LNK2001: unresolved external symbol __imp__NdisFreeMemory driver.obj : error LNK2001: unresolved external symbol __imp__NdisFreeBufferPool driver.obj : error LNK2001: unresolved external symbol __imp__NdisMFreeSharedMemory driver.obj : error LNK2001: unresolved external symbol __imp__NdisMDeregisterInterrupt driver.obj : error LNK2001: unresolved external symbol __imp__NdisMFreeMapRegisters driver.obj : error LNK2001: unresolved external symbol __imp__NdisMDeregisterIoPortRange driver.obj : error LNK2001: unresolved external symbol __imp__WRITE_PORT_UCHAR driver.obj : error LNK2001: unresolved external symbol __imp__NdisAllocateBuffer driver.obj : error LNK2001: unresolved external symbol __imp__NdisAllocatePacket driver.obj : error LNK2001: unresolved external symbol __imp__NdisAllocateBufferPool driver.obj : error LNK2001: unresolved external symbol __imp__NdisAllocatePacketPool driver.obj : error LNK2001: unresolved external symbol __imp__NdisMAllocateSharedMemory driver.obj : error LNK2001: unresolved external symbol __imp__READ_PORT_ULONG driver.obj : error LNK2001: unresolved external symbol _NdisAdjustBufferLength ioctrl.obj : error LNK2001: unresolved external symbol __imp_@IofCompleteRequest@8 ioctrl.obj : error LNK2001: unresolved external symbol __imp__IoDeleteSymbolicLink LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16 Debug/8139.exe : fatal error LNK1120: 40 unresolved externals Error executing link.exe. 8139.exe - 43 error(s), 30 warning(s) Current DDK Directory = C:\\NTDDK Building for i386 ******Configuration: 8139 - Win32 Debug ************* Invalid keyboard code specified New or updated MSVC detected. Updating DDK environment.... Setting environment for using Microsoft Visual C++ tools. Starting dirs creation...Completed. BUILD: Object root set to: ==> objchk BUILD: /i switch ignored BUILD: Compile and Link for i386 BUILD: Loading C:\\NTDDK\\build.dat... BUILD: Computing Include file dependencies: BUILD: c:\\progra~1\\micros~3\\vc98\\include\\exdisp.odl(31): c:\\progra~1\\micros~3\\vc98\\include\\exdisp.odl - invalid include statement: importlib(STDOLE_TLB); BUILD: c:\\progra~1\\micros~3\\vc98\\include\\vidsvr.odl(16): c:\\progra~1\\micros~3\\vc98\\include\\vidsvr.odl - invalid include statement: importlib(STDOLE_TLB); BUILD: Examining d:\\rtl8139\\8139 directory for files to compile. d:\\rtl8139\\8139 d:\\rtl8139\\8139 - 2 source files (1,781 lines) BUILD: Saving C:\\NTDDK\\build.dat... BUILD: Compiling d:\\rtl8139\\8139 directory Compiling - driver.c for i386 Compiling - ioctrl.c for i386 BUILD: Linking d:\\rtl8139\\8139 directory Linking Executable - objchk\\i386\\r8139.sys for i386 BUILD: Done 2 files compiled - 593 LPS 1 executable built Tool returned code: 0 |
|
29楼#
发布于:2005-05-13 23:00
少库了
|
|
|
30楼#
发布于:2005-05-14 09:38
Current DDK Directory = C:\\NTDDK
Building for i386 ******Configuration: 8139 - Win32 Debug ************* Invalid keyboard code specified New or updated MSVC detected. Updating DDK environment.... Setting environment for using Microsoft Visual C++ tools. Starting dirs creation...Completed. BUILD: Object root set to: ==> objchk BUILD: /i switch ignored BUILD: Compile and Link for i386 BUILD: Loading C:\\NTDDK\\build.dat... BUILD: Computing Include file dependencies: BUILD: c:\\progra~1\\micros~3\\vc98\\include\\exdisp.odl(31): c:\\progra~1\\micros~3\\vc98\\include\\exdisp.odl - invalid include statement: importlib(STDOLE_TLB); BUILD: c:\\progra~1\\micros~3\\vc98\\include\\vidsvr.odl(16): c:\\progra~1\\micros~3\\vc98\\include\\vidsvr.odl - invalid include statement: importlib(STDOLE_TLB); BUILD: Examining d:\\rtl8139\\8139 directory for files to compile. d:\\rtl8139\\8139 d:\\rtl8139\\8139 - 2 source files (1,781 lines) BUILD: Saving C:\\NTDDK\\build.dat... BUILD: Compiling d:\\rtl8139\\8139 directory Compiling - driver.c for i386 Compiling - ioctrl.c for i386 BUILD: Linking d:\\rtl8139\\8139 directory Linking Executable - objchk\\i386\\r8139.sys for i386 BUILD: Done 2 files compiled - 593 LPS 1 executable built Tool returned code: 0 这个编译不是已经成功了吗?产生sys文件了 :D |
|
|
31楼#
发布于:2005-05-14 12:46
编译是通过了,但是那是在VC内嵌得DS里面的BUILD产生的
用VC直接编译还是出现了上面的问题。 不知道是什么原因,我也知道是少了什么lib,但是在MSDN里面就是找不到 不知道在哪? 帮忙,帮我找找吧, :P |
|
32楼#
发布于:2005-05-14 15:07
编译是通过了,但是那是在VC内嵌得DS里面的BUILD产生的 不是qq里跟你说的少ndis.lib在DDK的安装目录下。。 |
|
|
33楼#
发布于:2005-05-14 23:10
这样呀,那谢谢了!
但是我的QQ没有收到你的留言呀?? 晕,呵呵,留言失踪了!^_^ 谢谢 |
|
34楼#
发布于:2005-05-17 09:54
又出现新的问题了!呵呵
再请教一下大哥大姐们,^_^ --------------------Configuration: 8139 - Win32 Debug-------------------- Linking... LINK : fatal error LNK1104: cannot open file \"odbcc6p326.lib\" Error executing link.exe. 8139.exe - 1 error(s), 0 warning(s) 为什么会出现这个问题,这不是工程object/library modules:里面自己定义的嘛? |
|
35楼#
发布于:2005-05-17 11:45
又出现新的问题了!呵呵 估计你的配置全错了 |
|
|
36楼#
发布于:2005-05-17 14:10
这样呀,那谢谢了! 呵呵,,你不是在群了问的吗。。我告诉你的。。。。 :D |
|
|
37楼#
发布于:2005-05-17 14:17
配置错误???
我用的是WIN2000(sp4)+2000DDK+VC6.0+DS2.7 那为什么aiwadgj大佬用DS3.0就能编译通过呢? 是不是要重装DDK,VC++和DS? 恳求指点 :( |
|
38楼#
发布于:2005-05-17 14:38
:)
我这个8139(for2000)的代码就是在驱动网上下的 如果哪位知道它应该有的配置,就请说明一下,的确是编译框架的结构与原来的不符。 谢了^_^ |
|
39楼#
发布于:2005-05-17 16:09
我说的是工程属性,不行,重装吧
先装vc,然后ddk,最后ds |
|
|