In the wince system, after the related development and system customization work is completed, the wince system will be compiled and the NK. Bin and NK. nb0 will be generated. I used wince6.0 to compile the program on my PC for 19 minutes and 16 seconds (I tested it one day when I was bored ). The compilation process of the wince system is roughly divided into four phases: Compile phase, sysgen phase, and release copy phase) and make run-time image phase ).
Process
It can be seen that the entire compilation is implemented by calling blddemo. bat. In fact, this is also the case. Compiling wince uses blddemo. bat, but it can be followed by different parameters. Finished. The following describes each stage.
1. Compile phase (compile phase)
This process is used to compile the private and public directories in the wince path and compile the source code into library files. This process may take several hours. Compilation is not required unless the source code in the private or public directory is changed. This step is not required when compiling our own project.
2. system generation phase (sysgen phase)
In this process, the system will delete and set the corresponding sysgen environment variables based on the options in the catalog in Pb, link the corresponding static library, and filter the header file, create the required Import and Export files for the SDK, and create some configuration files for the wince system. Finally, the current BSP and application will be compiled.
3. file copy phase (release copy phase)
Copy all required files to the project's release directory, mainly all files generated in the previous system generation phase.
4. Make run-time image phase)
First, cenlscmp.exe is used to generate the wince. NLS file based on the international language family and region settings. Then, you can use fmerge.exe to merge some configuration files and merge all bib files into Ce. bib, merge all Reg files into reginit. INI, merge all DAT files into initobj. dat, merge all dB files into initdb. ini. Later, you can use regcomp.exe to compress reginit. ini as default. FDF. When setting localenvironment variables, use res2exe.exe to update resource files in all DLL, EXE, and CPL files, which are mainly used to update the language. Then, use txt2ucde.exe to convert all ASCII code strings to Unicode. Use romimage.exe to merge all files into NK. Bin.
During the entire compilation process, sometimes a compilation error occurs. You can check the build. log, build. err and build. WRN file to analyze the problem. The three files should be located under the "/wince600" directory. Compilation errors may be generated at different compilation stages. We can also analyze the problem based on this.
Generally, errors in the system generation phase (sysgen phase) may be caused by the loss of components or files. At this time, build. log will provide more information to help you analyze the problem. Errors may occur during this phase due to the addition or deletion of the wince component in the current project. Some components need to be changed to "clean sysgen, instead of using the "sysgen" command. Therefore, I suggest "clean sysgen" every time you add or delete components ".
As described above, sysgen phase also compiles BSP and some applications. Therefore, if an error occurs during the compilation process of the system generation phase, it is generally possible that your code has a syntax error. Of course, this error can be easily checked. Another possible error is a connection error, which may be the loss of the Lib library file or the link to the wrong library file, or the call of the wrong API function, in addition, it is difficult to query the environment variables with errors.
If an error occurs during the file copy phase (release copy phase), a common problem is related to the hard drive. Check the disk space of the disk where the release directory is located.
If the problem occurs in the Make run-time image Phase Stage, determine the child stage of the problem based on the output information of the compiled output window. One possibility is that your bib file or reg file has a syntax error that may cause an error when merging files. Also, pay attention to whether your image size exceeds config. the setting in the bib file may also lead to the loss of some or some files, which may be caused by errors during the previous compilation process.
Of course, there may also be some strange problems, which may be caused by incorrect installation of wince. For example, when installing wince, do not contain Chinese characters, spaces, or other strange characters in the path. Patches must be installed in order, or problems may occur.