Symbian3/SDK/Source/GUID-78175610-72F4-5CAF-B1E9-9A761347C9DB.dita
author Dominic Pinkman <Dominic.Pinkman@Nokia.com>
Wed, 31 Mar 2010 11:11:55 +0100
changeset 7 51a74ef9ed63
parent 0 89d6a7a84779
child 13 48780e181b38
permissions -rw-r--r--
Week 12 contribution of API Specs and fix SDK submission

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE task
  PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<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>
    
    <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
TARGETTYPE	exe
UID      	0
SOURCEPATH	.
SOURCE		slhello.c
SYSTEMINCLUDE	\epoc32\include\libc  \epoc32\include

LIBRARY		estlib.lib euser.lib 
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>
<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">
      <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>
        
      <stepxmp>bldmake bldfiles</stepxmp><stepresult>This creates the &lt;file&gt;abld.bat&lt;/file&gt; batch file.</stepresult></step>
    <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>
    
    
    
  </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>