Troubleshooting: Building a Driver (Windows Embedded CE 6.0)
1/6/2010
The following table shows descriptions and resolutions of problems you may encounter while building your driver.
Description | Resolution |
---|---|
The build cannot find files you expected it to include. |
Ensure that the paths to the files are specified with the INCLUDES macro in the sources file. |
The C_DEFINES and RCOPTIONS macros in your sources file are not working. |
Use the CDEFINES and RDEFINES macros instead. The C_DEFINES and RCOPTIONS macros are only appropriate on a Windows-based desktop platform. |
You cannot compile Miniport.rc because the build cannot find Windows.h. |
Add the Windows.h file location to the RDEFINES macro in the sources file. |
Your object files are not building. |
Check the arguments you are passing to the build utilities. Ensure that you did not accidentally pass an empty argument when using a switch. |
The build cannot find a static library or you receive an error compiling your .def file because it cannot find Deffile.inc. |
Do not copy files to the location that the build utility is searching. Instead, run the Master Build tool (Cebuild.bat) from %_WINCEROOT% with the proper build environment settings. Running Cebuild.bat with the proper build environment settings generates the proper library and include directories for your build environment. Run Cebuild.bat from %_WINCEROOT% for every build configuration that you use to build your driver. For more information on Cebuild.bat, see Master Build Tool. |
You do not have a proper build environment for your driver. |
Create a project. Then, from the Build menu, choose Open Build Release Directory. This opens a command-line interface with the correct environment variables. You can then navigate to the directory where your driver resides, and then run the Build tool (Build.exe). For more information on Build.exe, see Build Tool. |
You do not want to use a project. |
Use the Windows Embedded CE Build Environment tool (Wince.bat). For more information on Wince.bat, see Windows Embedded CE Build Environment Tool |
You want to put your driver into the %_FLATRELEASEDIR% directory of your project. |
From the command line, type set WINCEREL=1. The build utility will move your driver to the %_FLATRELEASEDIR% directory. If it is a debug build, the .dll, .pdb, and .map files move to the %_FLATRELEASEDIR% directory as well. |
You want to change your %_FLATRELEASEDIR% environment variable. |
Type set _FLATRELEASEDIR=MyFlatReleaseDir. MyFlatReleaseDir is a placeholder for the flat release directory you choose. For more information on changing environment variables, see SET (Command Processor). |
The compiler behaves as if some structures and macros in header files do not exist, even though they do. |
Ensure that |
Sources files with NMAKE conditionals in them do not build properly. |
NMAKE understands conditionals, but Build.exe does not. Do not use conditionals in your sources files. |
See Also
Tasks
Troubleshooting a Device Driver