| View previous topic :: View next topic |
| Author |
Message |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Wed Jul 16, 2008 9:59 pm Post subject: Driver compiling error |
|
|
I'm starting driver programming and to start off I read noz3001's "Hello World!" tutorial. Anyway I made a folder in my C: drive and named it Drivers which holds: DriverMain.cpp, MAKEFILE, SOURCES, and a Release folder. Here are my errors:
| Quote: |
C:\WinDDK\6001.18001>cd ..
C:\WinDDK>cd ..
C:\>cd Drivers
C:\Drivers>build
path contains nonexistant d:\fpc\2.0.4\bin\i386-win32, removing
BUILD: Compile and Link for x86
BUILD: Computing Include file dependencies:
BUILD: Start time: Wed Jul 16 20:13:47 2008
BUILD: Examining c:\drivers directory for files to compile.
BUILD: Saving c:\winddk\6001.18001\build.dat...
BUILD: Compiling and Linking c:\drivers directory
_NT_TARGET_VERSION SET TO WINXP
errors in directory c:\drivers
c:\winddk\6001.18001\bin\makefile.new(2641) : error U1050: Your sources. file mu
st define the SOURCES macro.
errors in directory c:\drivers
nmake.exe /nologo BUILDMSG=Stop. -i BUILD_PASS=PASS2 LINKONLY=1 NOPASS0=1 MAKEDI
R_RELATIVE_TO_BASEDIR= failed - rc = 2
BUILD: Finish time: Wed Jul 16 20:13:50 2008
BUILD: Done
0 files compiled - 2 Warnings - 2 Errors
C:\Drivers>
|
And here's my code:
DriverMain.cpp:
| Code: |
#include <ntddk.h>
NTSTATUS DriverEntry(PDRIVER_OBJECT pDriverObject, PUNICODE_STRING pRegistryPath) {
DbgPrint("Hello World!");
pDriverObject->DriverUnload;
return STATUS_SUCCESS;
}
|
MAKEFILE:
| Code: |
!INCLUDE $(NTMAKEENV)\makefile.def
|
SOURCES:
| Code: |
TARGETNAME=oib111_Driver
TARGETPATH=Release
TARGETTYPE=DRIVER
TARGETSOURCE=DriverMain.cpp
|
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Wed Jul 16, 2008 10:10 pm Post subject: |
|
|
My Sources usually look like this:
| Code: | TARGETNAME=Name
TARGETPATH=obj
TARGETTYPE=DRIVER
SOURCES=main.c |
_________________
|
|
| Back to top |
|
 |
jackyyll Expert Cheater
Reputation: 0
Joined: 28 Jan 2008 Posts: 143 Location: here
|
Posted: Wed Jul 16, 2008 10:53 pm Post subject: |
|
|
Hmm, link to this tutorial? Interested in learning this also
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Wed Jul 16, 2008 11:38 pm Post subject: |
|
|
| lurc wrote: | My Sources usually look like this:
| Code: | TARGETNAME=Name
TARGETPATH=obj
TARGETTYPE=DRIVER
SOURCES=main.c |
|
Just wondering because his was actually DriverMain.c. Do drivers have to be programmed in C, or at least the source be a .c file (its an odd question I know)?
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
Posted: Thu Jul 17, 2008 12:47 am Post subject: |
|
|
| oib111 wrote: | | Just wondering because his was actually DriverMain.c. Do drivers have to be programmed in C, or at least the source be a .c file (its an odd question I know)? |
There are ways to program a driver in C++ or ASM, but it is widely accepted that drivers should be programmed in C.
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Thu Jul 17, 2008 8:40 am Post subject: |
|
|
Well, even if I save this as a .c file it doesn't do anything. I still get the errors.
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
jackyyll Expert Cheater
Reputation: 0
Joined: 28 Jan 2008 Posts: 143 Location: here
|
Posted: Thu Jul 17, 2008 9:20 am Post subject: |
|
|
| Code: |
TARGETNAME=oib111_Driver
TARGETPATH=Release
TARGETTYPE=DRIVER
TARGETSOURCE=DriverMain.cpp
|
Should be:
| Code: |
TARGETNAME=oib111_Driver
TARGETPATH=Release
TARGETTYPE=DRIVER
SOURCES=DriverMain.cpp
|
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Thu Jul 17, 2008 9:24 am Post subject: |
|
|
That helped, but still.
| Quote: |
C:\WinDDK\6001.18001>cd ..
C:\WinDDK>cd ..
C:\>cd Drivers
C:\Drivers>build
path contains nonexistant d:\fpc\2.0.4\bin\i386-win32, removing
BUILD: Compile and Link for x86
BUILD: Loading c:\winddk\6001.18001\build.dat...
BUILD: Computing Include file dependencies:
BUILD: Start time: Thu Jul 17 07:42:40 2008
BUILD: Examining c:\drivers directory for files to compile.
BUILD: Saving c:\winddk\6001.18001\build.dat...
BUILD: Compiling and Linking c:\drivers directory
_NT_TARGET_VERSION SET TO WINXP
BUILD: Finish time: Thu Jul 17 07:42:41 2008
BUILD: Done
0 files compiled - 1 Warning
C:\Drivers>
|
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
jackyyll Expert Cheater
Reputation: 0
Joined: 28 Jan 2008 Posts: 143 Location: here
|
Posted: Thu Jul 17, 2008 9:45 am Post subject: |
|
|
| oib111 wrote: | That helped, but still.
| Quote: |
C:\WinDDK\6001.18001>cd ..
C:\WinDDK>cd ..
C:\>cd Drivers
C:\Drivers>build
path contains nonexistant d:\fpc\2.0.4\bin\i386-win32, removing
BUILD: Compile and Link for x86
BUILD: Loading c:\winddk\6001.18001\build.dat...
BUILD: Computing Include file dependencies:
BUILD: Start time: Thu Jul 17 07:42:40 2008
BUILD: Examining c:\drivers directory for files to compile.
BUILD: Saving c:\winddk\6001.18001\build.dat...
BUILD: Compiling and Linking c:\drivers directory
_NT_TARGET_VERSION SET TO WINXP
BUILD: Finish time: Thu Jul 17 07:42:41 2008
BUILD: Done
0 files compiled - 1 Warning
C:\Drivers>
|
|
Use
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Thu Jul 17, 2008 9:54 am Post subject: |
|
|
Thank you! It worked! Btw, jackyll here's a link to the driver programming tutorial I'm about to read. I've read bits and pieces, and it's a good tutorial. Lots of explaining, helped me understand more about how programs work.
http://www.codeproject.com/KB/system/driverdev.aspx
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
jackyyll Expert Cheater
Reputation: 0
Joined: 28 Jan 2008 Posts: 143 Location: here
|
Posted: Thu Jul 17, 2008 9:57 am Post subject: |
|
|
| oib111 wrote: | Thank you! It worked! Btw, jackyll here's a link to the driver programming tutorial I'm about to read. I've read bits and pieces, and it's a good tutorial. Lots of explaining, helped me understand more about how programs work.
http://www.codeproject.com/KB/system/driverdev.aspx |
Cool. Thanks for the link, will have to read over this some time.
|
|
| Back to top |
|
 |
|