Symbian study Note 1

Source: Internet
Author: User
Tags codewarrior

Part 1: Explanation of the hello World Program

Symbian differences:
You need to handle the following:
Trap harness, cleanup stack, leave, heap Marking
That is, you need to perform the error check yourself,
Because there is no exception mechanism, Symbian uses cleanupstack to handle exceptions.
The trap macro is like catch (...) Function name with L is like throw
At last, you only need to use trap once in e32main to ensure no memory leakage.

For a C string, use _ L to convert it to the description used by symbain.
Symbian is object-oriented, so most C-library functions are encapsulated, such as printf
The entry to Symbian is the e32main function.
Gldef_c macro indicates that this function is a module interface.
Because C does not specify the length of the basic type, Symbian uses typedef to redefine the basic type. For example, tint16 indicates a 16-bit Int.

Compile:
Project definition file
Codewarrior or GCC can be used for compilation. We put the compilation information in the project definition file (with the extension. make project), and use other tools to convert the MMP file into a makefile or a project file in other environments (such as codewarrior. the following is hellotext. MPS content:
// Hellotext. MMP
Target hellotext.exe
Targettype exe
Sourcepath.
UID 0
Source hellotext. cpp
Userinclude.
Systeminclude epoc32include
Library euser. Lib
Target indicates the name of the generated executable file, and targettype indicates the type of the generated file, which is exe
UID is very important to the GUI program. Set it to 0
Sourcepath indicates the directory of the source file (. cpp)
Source indicates the source file name.
Userinclude and systeminclude indicate the directories of the header files declared by the user and the system header files.
Generally, we need to declare systeminclude as epoc32include.
The library declares the library to be linked. Generally, the E32 user library is required, that is, euser. Lib.

Component definition file
Symbian requires a component definition file named bld. inf, which contains all the engineering definition files (MMP s). In more complex cases, it includes other related information.
Below is the hellotext
// Bld. inf
Prj_matrix files
Hellotext. MMP

Compile
CD scmphellotext
Bldmake bldfiles
The above command generates the abld. BAT file under scmphellotext and creates the epoc32buildscmphellotext directory.
Abld build winscw udeb
Winscw indicates generating the codewarrior (CW) Simulator (win
In the project file of simulator. udeb indicates creating the debug version of Unicode.
Build is divided into the following six steps:
In the export process, output files are copied to their targets. General header files are copied to epoc32include. Most applications do not need any operation in this step.
Generate a required makefile or IDE workspace (such as a vc dsp file) in the makefile stage)
Create an input database in the library stage
Resource phase: Create Application resource files, bitmap and application information files (aufs)
Main execution file of the Application generated in the target stage
Perform any final operation in the final stage. Most programs do not need it here.

There are options for these stages in the abld tool. You can use abld help to get the options.

The final result is placed in epoc32releasewinscwudebhellotext.exe, where you can double-click it

Perform the following operations:
Bldmake bldfiles @ uiq_21: COM. Symbian. uiq
Abld build wins udeb @ uiq_21: COM. Symbian. uiq
Then run epoc32releasewinscwudebhellotext.exe
The reason why @ uiq_21: COM. Symbian. uiq is used is that the epocroot environment variable is not set, and two sets of Symbian environments are installed. One is installed in C: symbianuiq_21.

Create a program running on your phone
Abld build armi urel

Create an installation file
Run in scmphellotext
Makesys hellotext. PKG
This will generate hellotext. Sis. You can upload it to your mobile phone

Source: http://symbian.org.cn/bbs/viewtopic.php? T = 895

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.