Symbian3/SDK/Source/GUID-1560C4FF-82EC-5E5D-A37D-3BBE046F0A5B.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Tue, 20 Jul 2010 12:00:49 +0100
changeset 13 48780e181b38
parent 7 51a74ef9ed63
permissions -rw-r--r--
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.

<?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 concept
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="GUID-1560C4FF-82EC-5E5D-A37D-3BBE046F0A5B" xml:lang="en"><title>Target
Types</title><prolog><metadata><keywords/></metadata></prolog><conbody>
<ul>
<li id="GUID-2254E482-D730-5661-9878-6B90F17977F4"><p><xref href="GUID-1560C4FF-82EC-5E5D-A37D-3BBE046F0A5B.dita#GUID-1560C4FF-82EC-5E5D-A37D-3BBE046F0A5B/GUID-5D0338E0-E2D4-5904-9B21-244CA52DD91B">Generation of STDEXE, STDDLL and STDLIB</xref>  </p> </li>
<li id="GUID-F57FF724-6A83-5746-B85E-7548B8BD911A"><p><xref href="GUID-1560C4FF-82EC-5E5D-A37D-3BBE046F0A5B.dita#GUID-1560C4FF-82EC-5E5D-A37D-3BBE046F0A5B/GUID-801FC48D-BCE4-51A1-8D27-F66505A6C6AA">WCHARENTRYPOINT - new keyword</xref>  </p> </li>
<li id="GUID-D9117869-204F-51ED-8E40-F6D5F4D5889B"><p><xref href="GUID-1560C4FF-82EC-5E5D-A37D-3BBE046F0A5B.dita#GUID-1560C4FF-82EC-5E5D-A37D-3BBE046F0A5B/GUID-21D63C00-362C-50AE-BCAF-65572BF23F5E">External functions and symbols exported by default</xref>  </p> </li>
</ul>
<section id="GUID-5D0338E0-E2D4-5904-9B21-244CA52DD91B"><title>Generation
of STDEXE, STDDLL and STDLIB</title> <p>The introduction of two new Symbian
platform target types, <codeph>STDEXE</codeph> and <codeph>STDDLL</codeph>,
was required to enable the specific options for compilers and linkers to generate
P.I.P.S. executables. </p> <p>P.I.P.S. executables are implemented using native
Symbian platform executables linked statically to the glue code. The target
types <codeph>STDEXE</codeph> and <codeph>STDDLL</codeph> make symbol information
available for lookup by name. </p> <p>For each new target type the following
library files, system files and include paths are included <i>by default</i>.
The table below shows the additional libraries and paths for the new target
types. </p> <table id="GUID-8C82882E-0F2A-5CD0-B318-04FD5FC88A01">
<tgroup cols="3"><colspec colname="col0"/><colspec colname="col1"/><colspec colname="col2"/>
<tbody>
<row>
<entry><p> <b>Target Type</b>  </p> </entry>
<entry><p> <b>File/Path</b>  </p> </entry>
<entry><p> <b>Purpose</b>  </p> </entry>
</row>
<row>
<entry><p> <codeph>STDEXE</codeph>  </p> </entry>
<entry><p> <filepath>libcrt0.lib</filepath>  </p> </entry>
<entry><p>Multithreaded 'glue code' library. Provides the <xref href="GUID-92602438-C8AC-3E15-ABB1-DCB8E8771E0C.dita"><apiname>E32Main()</apiname></xref> entry
point for a <filepath>.exe</filepath> that uses the char <xref href="GUID-13E4A48A-07DB-34E6-B220-C4B134D6DF13.dita"><apiname>main()</apiname></xref> function. </p> </entry>
</row>
<row>
<entry><p> <codeph>STDEXE</codeph>  </p> </entry>
<entry><p> <filepath>libwcrt0.lib</filepath>  </p> </entry>
<entry><p>Multithreaded 'glue code' library. Provides the <codeph>E32Main()</codeph> entry
point for a <filepath>.exe</filepath> that uses the wide char <codeph>main()</codeph> function. </p> </entry>
</row>
<row>
<entry><p> <codeph>STDEXE</codeph> | <codeph>STDDLL</codeph> | <codeph>STDLIB</codeph>  </p> </entry>
<entry><p> <filepath>euser.lib</filepath>, <filepath>backend.lib</filepath>  </p> </entry>
<entry><p>Fundamental libraries that are linked by default for <codeph>STDEXE</codeph> s
and <codeph>STDDLL</codeph> s. </p> </entry>
</row>
<row>
<entry><p> <codeph>STDEXE</codeph> | <codeph>STDDLL</codeph> | <codeph>STDLIB</codeph>  </p> </entry>
<entry><p> <filepath>\epoc32\include\stdapis</filepath>  </p> </entry>
<entry><p>Location of standard header files for P.I.P.S.. </p> </entry>
</row>
</tbody>
</tgroup>
</table> <p>The new target types for P.I.P.S. are <codeph>STDEXE</codeph>, <codeph>STDDLL</codeph> and <codeph>STDLIB</codeph> (<codeph>STDLIB</codeph> s are the P.I.P.S. static libraries). For <codeph>STDLIB</codeph> s, the
user need not annotate source with <xref href="GUID-2F78C3AC-7330-34C0-8A83-75D7345F2DC8.dita"><apiname>EXPORT_C</apiname></xref> or <xref href="GUID-BD292953-36BF-3C7D-AA93-98E6CB38968E.dita"><apiname>IMPORT_C</apiname></xref>.
All symbols with <codeph>extern</codeph> linkage are: </p> <ol id="GUID-9D6A6BB0-C2DC-50F5-B5D4-97CBD381D10A">
<li id="GUID-7828C346-6ED2-5B6A-B89D-12D988FED39E"><p>exported if they are
defined in the module, and </p> </li>
<li id="GUID-42BFE700-719A-5DE9-8732-30E82DBAE304"><p>imported if they are
referred to but not defined. </p> </li>
</ol> <p>The compiler marks the symbols imported/exported for <codeph>STDLIB</codeph> s,
while for native Static Libraries the user explicitly needs to specify <codeph>EXPORT_C</codeph> /<codeph>IMPORT_C</codeph>. </p> </section>
<section id="GUID-801FC48D-BCE4-51A1-8D27-F66505A6C6AA"><title>WCHARENTRYPOINT
- new keyword</title> <p>The user should include the new keyword <codeph>WCHARENTRYPOINT</codeph> in
MMP files to select the <xref href="GUID-6CDDDD1E-BDB9-5C61-8EFD-8B3369F5A12D.dita#GUID-6CDDDD1E-BDB9-5C61-8EFD-8B3369F5A12D/GUID-49C7F951-8317-5F41-B1B9-9F7B8803E655">Glue
code (CRT0)</xref> library for the wide char main entry point, <filepath>libwcrt0.lib</filepath>.
This option is valid only for the <codeph>STDEXE</codeph> target type and
will be ignored if used with other target types. </p> </section>
<section id="GUID-21D63C00-362C-50AE-BCAF-65572BF23F5E"><title>External functions
and symbols exported by default </title> <p>With a <codeph>STDDLL</codeph> library,
functions and data with external linkage are exported by default, without
any requirement for the <xref href="GUID-BD292953-36BF-3C7D-AA93-98E6CB38968E.dita"><apiname>IMPORT_C</apiname></xref> and <xref href="GUID-2F78C3AC-7330-34C0-8A83-75D7345F2DC8.dita"><apiname>EXPORT_C</apiname></xref> declarations
in header or source files. It is important to note that in the Linux world
all symbols with external linkage are visible outside a shared object. </p> <p>When
porting C APIs to the Symbian platform, the user should use the
new <codeph>STDDLL</codeph> target type to indicate to the tool chain that
all functions and global data should be exported. </p> </section>
</conbody></concept>