In the wince system, when we have completed the relevant development and system customization work, will compile the wince system, the final generation of Nk.bin and nk.nb0. I'm now compiling it on my PC with WinCE6.0 19 minutes and 16 seconds (one day bored and measured). The following is an introduction to the WinCE system's compilation process, which is roughly divided into 4 phases: the compile phase (Compile phase), the system generation phase (Sysgen phase), the file copy phase (release copy phase), and the build image phase (make Run-time image phase).
Process as shown:
As can be seen from the diagram, the entire compilation is achieved by calling Blddemo.bat, in fact, the compilation wince is to use Blddemo.bat, only the following can be followed by different parameters. The compile phase and system generation phase are completed by Cebuild.bat, the file copy phase is completed by Buildrel.bat, and the final generation image phase is completed by Makeimg.exe. Here are the stages.
1. Compile phase (Compile phase)
This process refers to the wince path of the private and public directory to compile, the source code compiled into a library file, etc., this process may take several hours. Unless you change the private or public directory of the source code, otherwise you do not need to compile. In general, we do not need this step when compiling our own projects.
2. System generation phase (Sysgen phase)
In this process, the system will delete and set the corresponding Sysgen environment variables according to your catalog in Pb, link the corresponding static library, filter the header file, create the required import library for the SDK, and also create some configuration files for the wince system. Finally, the current BSP and application are compiled.
3. File copy phase (release copy phase)
Copy all the required files to the project release directory, mainly the previous system generation phase of all the files.
4. Build image phase (make Run-time image phase)
The process first invokes Cenlscmp.exe to generate WINCE.NLS files based on international language and locale settings. Then call Fmerge.exe Merge some configuration files, merge all bib files as Ce.bib, merge all the reg files as Reginit.ini, merge all the DAT files as Initobj.dat, and merge all the db files as Initdb.ini. The Regcomp.exe compression Reginit.ini is then called DEFAULT.FDF. Call Res2exe.exe to update all the resource files in the Dll,exe and Cpl files based on the settings of the local environment variable, primarily by updating the language portion of it. Then call Txt2ucde.exe to convert all ASCII code strings to Unicode. The last call Romimage.exe merges all files as Nk.bin.
Compile errors are sometimes encountered throughout the compilation process, which can be analyzed by looking at the Build.log,build.err and Build.wrn files, which should be located under the "WINCE600" directory. Compilation errors may occur at different compile stages, and we can also analyze the problem based on this.
Typically, errors in the System generation phase (Sysgen phase) may be caused by missing components or files, and Build.log will provide more information to help analyze the problem. Errors are generated at this stage, most likely due to the addition or deletion of wince components in the current project, some of which require a "clean sysgen" and cannot use only the "Sysgen" command. So my advice is to do "clean sysgen" every time you add or remove components.
As described above the system generation phase (Sysgen phase) will also compile BSP and partial applications. So if the error occurs in the system generation phase of the compilation process, the general one may be that your code has syntax errors, of course, this error is very good to check. There is also a possible error is a connection error, it is possible to lose the Lib library file or link the wrong library file, it is possible to call the wrong API function, there is set the wrong environment variables, these are relatively difficult to find.
If errors occur in the file copy phase (release copy phase), a common problem is with the hard drive, check the disk space on the disk where the release directory resides.
If the problem occurs during the build image phase (make run-time image phase), determine which child phase the problem is based on the output information of the compiled Output window. One possibility is that a syntax error in your bib file or a reg file causes an error in merging the file. Also be aware that your image size exceeds the set in the Config.bib file, and that you may have lost some or some of the files, which are most likely caused by errors in the previous compilation process.
Of course, sometimes there are some strange problems, these problems may be due to the improper installation of wince caused by, for example, in the installation of wince, the path should not have Chinese or white space or other strange characters. Patches are to be played in order, or problems may occur.