Click here to Skip to main content
15,911,360 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everyone,

I have a question and I hope to be answered by you.

My question is :
I started to write my first program in driver programming.
The program is about "Hello word"

I have installeed VS2010 and WDK to start .

But unfortunately I have a problem that appears when I was compiling my program.

The error is like this:

MSIL
1>------ Build started: Project: driver, Configuration: Debug Win32 ------
1>  test1.c
1>c:\winddk\7600.16385.1\inc\ddk\wdm.h(14196): fatal error C1189: #error :  "No target architecture defined"
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


I need a solution for this problem, Please
Posted
Updated 12-Jan-11 22:16pm
v2
Comments
Dalek Dave 13-Jan-11 4:16am    
Edited for Grammar, Spelling and Syntax.

Although this is an old question but the correct answer is to use the DDKBuild.cmd from OSR to build your driver with Visual Studio.

- The link is here "http://www.osronline.com/article.cfm?article=43"

Here are the steps to use VS2010 and WDK to build driver.

1. Install VS
2. Install WDK
3. Setup the WDK environment - BASEDIR env variable
4. Create a Make project - create the SOURCES, DIRS and other driver required files.
5. Open the project property page, set the build command to use the DDKBuild.cmd (check the DDKBUILD for the command options)
6. Create a RELEASE build by repeat the step #5 with the "fre" build option.

Now you can use the build command from VS to build the driver. For detailed information, google "ddkbuild" for results.

Notes: the previous answer said you do not need VS to build driver which is correct; but using VS to build driver make your life easier if you want a nice editor to look at the code and other editings.
* A dude complained that this answer is the same as the 1st one. Obviously he did not read and understand what the 1st answer meant. My point: stop pointing people the Microsoft half-baked solution. Use the OSR batch file and save yourself some headaches.
 
Share this answer
 
v2
Comments
Espen Harlinn 11-Jan-11 15:28pm    
http://www.microsoft.com/whdc/DevTools/WDK/buildenv.mspx includes information about Ddkbuild ... and it provides a link to http://www.osronline.com/article.cfm?article=43
Espen Harlinn 11-Jan-11 16:27pm    
Who voted a 5+ for this? It only provides the same info as <<_Superman_>>
GotCodeToo 13-Jan-11 4:13am    
I usually do not engage in this "feeding troll" activity but...

<<_Superman_>> did not answer the question - if you bother to read what the answer is. The guy asked how to build driver with VS, not what is the Microsoft recommended way to build driver. So to point the guy to read how MS want you to go through their half-bake solution is not that helpful. Read the question and answers before assuming they are the same information.
Espen Harlinn 13-Jan-11 8:14am    
Sorry - I didn't intend any "feeding troll" activity http://en.wikipedia.org/wiki/Troll_(Internet).

My initial reaction to your answer was that the phrasing could be understood as an indication that the previously given answer was somehow wrong.

I feel that given a reasonable nice link, we should be able to expect some browsing and reading skills from people working on device drivers. Maybe I was a bit harsh ..., I could just have downvoted your answer, but I didn't :) BTW: the dude has built a couple of device drivers using the WDK with Visual Studio, and know how to write makefiles.
You do not need Visual Studio to build drivers.
Drivers are usually built from the command line using the build utility which makes use of a sources file.
Read about the driver build environment here - http://www.microsoft.com/whdc/DevTools/WDK/buildenv.mspx[^]
 
Share this answer
 
Comments
Dalek Dave 13-Jan-11 4:17am    
Why are you telling him to do the complete opposite of what he wants?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900