Symbian3/SDK/Source/GUID-D32E52C9-F05C-5F1E-8B49-243D555C353C.dita
changeset 0 89d6a7a84779
child 2 ebc84c812384
equal deleted inserted replaced
-1:000000000000 0:89d6a7a84779
       
     1 <?xml version="1.0" encoding="utf-8"?>
       
     2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
       
     3 <!-- This component and the accompanying materials are made available under the terms of the License 
       
     4 "Eclipse Public License v1.0" which accompanies this distribution, 
       
     5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
       
     6 <!-- Initial Contributors:
       
     7     Nokia Corporation - initial contribution.
       
     8 Contributors: 
       
     9 -->
       
    10 <!DOCTYPE concept
       
    11   PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
       
    12 <concept id="GUID-D32E52C9-F05C-5F1E-8B49-243D555C353C" xml:lang="en"><title>Known
       
    13 Issues</title><prolog><metadata><keywords/></metadata></prolog><conbody>
       
    14 <p>This topic describes the known issues associated with developing Standard
       
    15 C++ applications or libraries on Symbian platform. </p>
       
    16 <p>The following functionalities of Standard C++ have certain limitations
       
    17 on Symbian platform: </p>
       
    18 <ul>
       
    19 <li id="GUID-8A496C80-74F0-559D-84B3-34EF8BA15A39"><p> <b>dynamic_cast:</b> The <codeph>dynamic_cast</codeph> operator
       
    20 is not fully supported on Symbian platform. </p> </li>
       
    21 <li id="GUID-012F6B22-4A66-5B54-B981-01A252F10147"><p> <b>unexpected_handler:</b> The
       
    22 CodeWarrior runtime does not support the invocation of <codeph>unexpected_handler</codeph> upon
       
    23 an exception specification violation. </p> </li>
       
    24 <li id="GUID-9FF61C6B-21D4-521D-A1FF-086D28FDAADF"><p> <b>IOStreams:</b> The <codeph>cin</codeph> and <codeph>cout</codeph> objects
       
    25 are instances of <codeph>istream</codeph> and <codeph>ostream</codeph> classes
       
    26 and are exported by the STL library. As the emulator tool-chain does not support
       
    27 exporting of data, these are defined as function calls on the emulator. </p> <p>These
       
    28 functions return references to the <codeph>cin</codeph> and <codeph>cout</codeph> objects
       
    29 that the STL library maintains. Since they are defined as functions, an attempt
       
    30 to import namespace by saying using <codeph>std::cout</codeph> may fail to
       
    31 compile. To resolve this issue, include the entire <codeph>std</codeph> namespace
       
    32 in such scenarios. </p> </li>
       
    33 </ul>
       
    34 <section id="GUID-EB8B9B0E-0971-4147-B8FB-94F2D602B61F"><title>ARM RVCT compiler
       
    35 issues with STLport</title><p>Due to a defect in the ARM RVCT compiler versions
       
    36 2.2, 3.1 and 4.0, building STLport v5 or STLport-based applications, creates
       
    37 some invalid export entries in DEF files. To workaround this issue, perform
       
    38 the following steps:</p><ol>
       
    39 <li id="GUID-6BD383B8-C6C8-4C08-A741-2D90C21D274F"><p>Use the GCCE compiler
       
    40 to generate the DEF file, if it is not available.</p></li>
       
    41 <li id="GUID-EA6CD191-69CA-4AA5-80FB-704F52F583F6"><p>Ignore the warnings
       
    42 generated by the ARM RVCT compiler.</p><note>When you ignore the warnings,
       
    43 do not freeze the invalid export entries in the DEF file using the ARM RVCT
       
    44 compiler.</note></li>
       
    45 </ol></section>
       
    46 <section id="GUID-6008A836-2454-49E5-BE25-29EB9074CF88"><title>Using the id
       
    47 member variable of facet classes</title> <p>Symbian platform does not support
       
    48 exporting static data. Hence, the <codeph>id</codeph> member variable of facet
       
    49 classes (<codeph>static locale::id           id</codeph>) cannot be used directly
       
    50 on Symbian platform. When you use these classes you must use the <codeph>GetFacetLocaleId()</codeph> function
       
    51 to access the data member <codeph>id</codeph> instead. </p> <p> <b>Examples</b>  </p> <ol id="GUID-96B64FD3-382E-56E1-BAD6-90DFBDA0969F">
       
    52 <li id="GUID-20337C94-A194-5BD7-9974-490C1EBB543F"><p> <b>Using the id member
       
    53 of standard facets:</b> For example, you can change <codeph>locale::id Id1
       
    54 =                 numpunct&lt;char&gt;::id;</codeph> to <codeph>locale::id Id1
       
    55 =                 numpunct&lt;char&gt;::GetFacetLocaleId();</codeph>. </p> </li>
       
    56 <li id="GUID-F91F6741-FA71-5644-BE02-717E5872B293"><p> <b>Deriving a class
       
    57 from a standard facet:</b> Declare a <codeph>GetFacetLocaleId()</codeph> static
       
    58 method, in addition to the member variable ID, when you define a class that
       
    59 is inherited from the <codeph>locale::facet</codeph> class, as illustrated
       
    60 in the following code: </p> <codeblock id="GUID-692D5326-4048-52DC-8347-5006CBEFAF0F" xml:space="preserve">class myfacet : public locale::facet
       
    61     {
       
    62     public:
       
    63     static locale::id id;
       
    64     static locale::id&amp; GetFacetLocaleId() 
       
    65         {
       
    66         return id;
       
    67         } 
       
    68     };</codeblock> </li>
       
    69 <li id="GUID-600D7CAC-C9C5-5722-987A-66FE6E2D7D01"><p> <b>Using a class that
       
    70 is part of a DLL:</b> Ensure that you also handle the Writable Static Data
       
    71 (WSD) issues for emulator (WINSCW) builds along with the issues described
       
    72 in examples <b>1</b> and <b>2</b> as illustrated in the following code: </p> <codeblock id="GUID-8307FD25-D980-5FC1-A0FB-83098BE5D331" xml:space="preserve">//myfacet.h
       
    73 class myfacet : public locale::facet
       
    74     {
       
    75     public:
       
    76 #ifndef __WINSCW__  
       
    77     static locale::id id;
       
    78 #endif
       
    79     static locale::id&amp; GetFacetLocaleId();
       
    80     };
       
    81 </codeblock> <codeblock id="GUID-57B95E9E-9071-50CC-A688-73C9781B26E4" xml:space="preserve">//myfacet.cpp
       
    82 std::locale::id&amp; myfacet::GetFacetLocaleId()
       
    83     {
       
    84 #ifndef __WINSCW__  
       
    85     return id;
       
    86 #else
       
    87     // get the WSD struct – uses EWSD solution
       
    88     // get_wsd_struct() is a function defined by
       
    89                 // the user to get a pointer to his WSD struct.
       
    90     return get_wsd_struct()-&gt;myfacet_id;
       
    91 #endif
       
    92     }</codeblock> </li>
       
    93 </ol> </section>
       
    94 <section id="GUID-35767460-AE19-47D2-B24F-0CFEC8B999EF"><title>Using memory
       
    95 leak detection macros</title> <p>On an emulator, there are some dynamic memory
       
    96 allocations made for supporting WSD, when the Standard C++ library is initialised.
       
    97 In this scenario, if you add a memory leak detection macro, such as <codeph>__UHEAP_MARK</codeph> and <codeph>__UHEAP_MARKEND</codeph>,
       
    98 then you get a panic at <codeph>__UHEAP_MARKEND</codeph>. </p> <p>To avoid
       
    99 this panic, you must call the <codeph>CleanupWSD()</codeph> function, provided
       
   100 only for use on emulator. For more information about how to achieve this,
       
   101 see the following example code: </p> <codeblock id="GUID-52610746-62BA-5EDB-A584-091CD6724260" xml:space="preserve">#include &lt;iostream&gt;
       
   102 using namespace std;
       
   103 #ifdef __WINSCW__
       
   104 #include &lt;libstdcppwsd.h&gt;
       
   105 #endif
       
   106 int main()
       
   107     {
       
   108     __UHEAP_MARK;
       
   109     cout &lt;&lt; "Hello, World!" &lt;&lt; endl;
       
   110 #ifdef __WINSCW__
       
   111     CleanupWSD();// Cleanup all WSD related allocations
       
   112 #endif
       
   113     __UHEAP_MARKEND;
       
   114     return 0;
       
   115     }</codeblock> </section>
       
   116 </conbody><related-links>
       
   117 <link href="GUID-D6BEAF0D-844D-51F4-8DB7-FB1D60E17FE3.dita"><linktext>Copyright
       
   118 Acknowledgments for Standard C++                 (STLport)</linktext></link>
       
   119 <link href="GUID-F7FEB759-E64D-5B6D-9017-C5E982E4FC16.dita"><linktext>Standard
       
   120 C++ Library Overview</linktext></link>
       
   121 <link href="GUID-2CCD1748-9EDE-5383-9941-A3051E06F3E2.dita"><linktext>Standard
       
   122 C++ Support on Symbian Platform</linktext></link>
       
   123 <link href="GUID-CDE8CD85-8467-5B36-A0AC-41D1D98151CA.dita"><linktext>Developing
       
   124 Applications or Libraries                 Using Standard C++</linktext></link>
       
   125 <link href="GUID-E331B72B-84AF-558A-9B8F-73E5E50B58C7.dita"><linktext>Building
       
   126 a Standard C++ Application or                 Library</linktext></link>
       
   127 <link href="GUID-5B3F5296-D6D0-5D25-8362-141DF5927E52.dita"><linktext>Troubleshooting</linktext>
       
   128 </link>
       
   129 </related-links></concept>