Symbian3/SDK/Source/GUID-78175610-72F4-5CAF-B1E9-9A761347C9DB.dita
changeset 13 48780e181b38
parent 0 89d6a7a84779
equal deleted inserted replaced
12:80ef3a206772 13:48780e181b38
     7     Nokia Corporation - initial contribution.
     7     Nokia Corporation - initial contribution.
     8 Contributors: 
     8 Contributors: 
     9 -->
     9 -->
    10 <!DOCTYPE task
    10 <!DOCTYPE task
    11   PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
    11   PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
    12 <task id="GUID-78175610-72F4-5CAF-B1E9-9A761347C9DB" xml:lang="en"><title>Hello World: A minimal console application</title><shortdesc>This section describes the steps to build the Hello World project on the emulator.</shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody>
    12 <task id="GUID-78175610-72F4-5CAF-B1E9-9A761347C9DB" xml:lang="en"><title>Hello
    13     
    13 World: A minimal console application</title><shortdesc>This section describes the steps to build the Hello World
    14     <context id="CONTEXT_860ECC705FBE48F2B9F0EDD54C40E65E"><p>The code in this section has been taken from the <filepath>Hello</filepath> example.</p><p>This example demonstrates the most basic use of STDLIB. It consists of the single source code file, <filepath>slhello.c</filepath> whose sole function, <codeph>main()</codeph> calls <codeph>printf()</codeph>.</p><p>The <filepath>Hello</filepath> example's project definition file (<filepath>Hello.mmp</filepath>) contains the following:</p><codeblock xml:space="preserve">TTARGET		hello.exe
    14 project on the emulator.</shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody>
       
    15 <context id="CONTEXT_860ECC705FBE48F2B9F0EDD54C40E65E"><p>The code
       
    16 in this section has been taken from the <filepath>Hello</filepath> example.</p><p>This example demonstrates the most basic use of STDLIB.
       
    17 It consists of the single source code file, <filepath>slhello.c</filepath> whose sole function, <codeph>main()</codeph> calls <codeph>printf()</codeph>.</p><p>The <filepath>Hello</filepath> example's project definition
       
    18 file (<filepath>Hello.mmp</filepath>) contains the following:</p><codeblock xml:space="preserve">TTARGET		hello.exe
    15 TARGETTYPE	exe
    19 TARGETTYPE	exe
    16 UID      	0
    20 UID      	0
    17 SOURCEPATH	.
    21 SOURCEPATH	.
    18 SOURCE		slhello.c
    22 SOURCE		slhello.c
    19 SYSTEMINCLUDE	\epoc32\include\libc  \epoc32\include
    23 SYSTEMINCLUDE	\epoc32\include\libc  \epoc32\include
    20 
    24 
    21 LIBRARY		estlib.lib euser.lib 
    25 LIBRARY		estlib.lib euser.lib 
    22 STATICLIBRARY	ecrt0.lib</codeblock><note><ul id="UL_DFDA8F9623D74CA297DE7441131DB52D"><li id="LI_B1C004435F2D43C1B1FDE677EEBA847C">The import library <filepath>estlib.lib</filepath> is the C standard library.</li><li id="LI_EF2D86C46EC849CBB89C035811A0A3FA">The project also links to <filepath>ecrt0.lib</filepath>. This file provides the <codeph>E32Main()</codeph> entrypoint for a <filepath>.exe</filepath>. It also provides other services including command-line parsing, and it calls <codeph>main()</codeph>.</li><li id="LI_08D804A3357E42279398B608D9C94D63">The <codeph>SYSTEMINCLUDE</codeph> path specifies <filepath>\epoc32\include\libc\</filepath>, which is the location for STDLIB's header files.</li></ul></note>
    26 STATICLIBRARY	ecrt0.lib</codeblock><note><ul id="UL_DFDA8F9623D74CA297DE7441131DB52D">
    23 <p>For more information on the project specification for a <filepath>.exe</filepath> see <xref href="GUID-12D8C373-5199-5B89-9910-00F769AC164A.dita">How to build for an EXE target</xref>.</p></context><steps id="STEPS_FDBDA20C062F4610B084E58AD673A4E1">
    27 <li id="LI_B1C004435F2D43C1B1FDE677EEBA847C">The import library <filepath>estlib.lib</filepath> is the C standard library.</li>
    24       <step id="STEP_AD6C049FEF1C4BA89DEFD358291184A3"><cmd>To build <filepath>Hello</filepath> for the Emulator, run <filepath>bldmake</filepath> from the directory where the <filepath>bld.inf</filepath> file is located:</cmd>
    28 <li id="LI_EF2D86C46EC849CBB89C035811A0A3FA">The project also links
    25         
    29 to <filepath>ecrt0.lib</filepath>. This file provides the <codeph>E32Main()</codeph> entrypoint for a <filepath>.exe</filepath>. It
    26       <stepxmp>bldmake bldfiles</stepxmp><stepresult>This creates the &lt;file&gt;abld.bat&lt;/file&gt; batch file.</stepresult></step>
    30 also provides other services including command-line parsing, and it
    27     <step id="STEP_51BCB62257004034AAEDACCDCB219974"><cmd>Use <filepath>abld</filepath> to build the project, for instance:</cmd><stepxmp>abld build wins udeb</stepxmp></step><step id="STEP_6C69AE8D4AA64378BFE1B6AE443663A4"><cmd>To run it, invoke <filepath>hello.exe</filepath></cmd></step><step id="STEP_859A8F380CF04A4E86DC4CD787724E9E"><cmd>To build <filepath>Hello</filepath> for the target machine, invoke <codeph>bldmake</codeph> and <codeph>abld</codeph>, specifying the appropriate target platform.</cmd></step><step id="STEP_155632C1EC5B47C0A513D196B947AD8F"><cmd>To install software on the target device create a <filepath>.sis</filepath> file using the Symbian Installation system. </cmd><tutorialinfo>See the <xref href="GUID-0AF47934-0A16-51A2-9254-992D7C6B322B.dita">Application Installation Guide</xref></tutorialinfo></step></steps>
    31 calls <codeph>main()</codeph>.</li>
    28     
    32 <li id="LI_08D804A3357E42279398B608D9C94D63">The <codeph>SYSTEMINCLUDE</codeph> path specifies <filepath>\epoc32\include\libc\</filepath>, which
    29     
    33 is the location for STDLIB's header files.</li>
    30     
    34 </ul></note> </context>
    31   </taskbody><related-links><link href="GUID-12D8C373-5199-5B89-9910-00F769AC164A.dita"><linktext>How to build for an EXE target</linktext></link><link href="GUID-3100800B-B2F7-50EF-BD4C-3C345ECCB2A5.dita"><linktext>How to use the Symbian build process</linktext></link><link href="GUID-0AF47934-0A16-51A2-9254-992D7C6B322B.dita"><linktext>Application Installation Guide</linktext></link></related-links></task>
    35 <steps id="STEPS_FDBDA20C062F4610B084E58AD673A4E1">
       
    36 <step id="STEP_AD6C049FEF1C4BA89DEFD358291184A3"><cmd>To build <filepath>Hello</filepath> for the Emulator, run <filepath>bldmake</filepath> from the directory where the <filepath>bld.inf</filepath> file is
       
    37 located:</cmd>
       
    38 <stepxmp>bldmake bldfiles</stepxmp>
       
    39 <stepresult>This creates the &lt;file&gt;abld.bat&lt;/file&gt; batch file.</stepresult>
       
    40 </step>
       
    41 <step id="STEP_51BCB62257004034AAEDACCDCB219974"><cmd>Use <filepath>abld</filepath> to build the project, for instance:</cmd>
       
    42 <stepxmp>abld build wins udeb</stepxmp>
       
    43 </step>
       
    44 <step id="STEP_6C69AE8D4AA64378BFE1B6AE443663A4"><cmd>To run it, invoke <filepath>hello.exe</filepath></cmd>
       
    45 </step>
       
    46 <step id="STEP_859A8F380CF04A4E86DC4CD787724E9E"><cmd>To build <filepath>Hello</filepath> for the target machine, invoke <codeph>bldmake</codeph> and <codeph>abld</codeph>, specifying the appropriate target platform.</cmd>
       
    47 </step>
       
    48 <step id="STEP_155632C1EC5B47C0A513D196B947AD8F"><cmd>To install software
       
    49 on the target device create a <filepath>.sis</filepath> file using
       
    50 the Symbian Installation system. </cmd>
       
    51 <tutorialinfo>See the <xref href="GUID-0AF47934-0A16-51A2-9254-992D7C6B322B.dita">Application Installation
       
    52 Guide</xref></tutorialinfo>
       
    53 </step>
       
    54 </steps>
       
    55 </taskbody><related-links>
       
    56 <link href="GUID-0AF47934-0A16-51A2-9254-992D7C6B322B.dita"><linktext>Application
       
    57 Installation Guide</linktext></link>
       
    58 </related-links></task>