Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Ports of STL are officially <strong>available in the Android NDK from version r5</strong> on. It can be used either as a static or shared library. The following implementations are available prebuilt with the NDK :</p> <ul> <li><a href="http://www.stlport.org" rel="noreferrer">STLport</a>, based on v5.2.0 : <ul> <li>static <code>stlport_static</code> : use if you have only one dynamic library in your project.</li> <li>dynamic <code>stlport_shared</code> : to use if you have more than one dynamic library in your project.</li> </ul></li> <li>GNU libstdc++ <code>system</code> (static library)</li> </ul> <p><strong>The recommended, easy way to use it</strong> at build time is by defining APP_STL in the Application.mk, like this :</p> <pre><code>APP_STL := stlport_static </code></pre> <p>And if you want to rebuild it (this is <em>not</em> necessary), define STLPORT_FORCE_REBUILD in your Application.mk :</p> <pre><code>STLPORT_FORCE_REBUILD := true </code></pre> <p>The unit test framework for STLport is also available.</p> <p><strong>Current limitations for STLport</strong> :</p> <ul> <li>C++ Exceptions not supported</li> <li>RTTI not supported</li> <li>"Probable bugs" in support for <code>wchar_t</code> and locales</li> </ul> <p><strong>Various Links :</strong> </p> <p>Documentation is available in the NDK packages at the following locations (there may be more) : </p> <ul> <li>docsCPLUSPLUS-SUPPORT.html</li> <li>sources/cxx-stl/stlport</li> <li>sources/cxx-stl/gnu-libstdc++</li> </ul> <p>Download NDK + docs <a href="http://developer.android.com/sdk/ndk/index.html" rel="noreferrer">here</a> ; file bugs <a href="http://b.android.com" rel="noreferrer">here</a></p> <hr> <p><em>Below is an excerpt from docs/CPLUSPLUS-SUPPORT.html (from NDK docs, r5)</em></p> <h2>III. Selecting the C++ Standard Library Implementation:</h2> <p>By default, the headers and libraries for the minimal C++ runtime system library (/system/lib/libstdc++.so) are used when building C++ sources.</p> <p>You can however select a different implementation by setting the variable APP_STL to something else in your Application.mk, for example:</p> <p>APP_STL := stlport_static</p> <p>To select the static STLport implementation provided with this NDK. Value APP_STL values are the following:</p> <p>system -> Use the default minimal C++ runtime library. stlport_static -> Use STLport built as a static library. stlport_shared -> Use STLport built as a shared library.</p> <p>WARNING: IMPORTANT CAVEAT</p> <pre><code> AT THE MOMENT, OUR STLPORT IMPLEMENTATION DOES NOT SUPPORT EXCEPTIONS AND RTTI. PLEASE BE SURE TO NOT USE -fexceptions OR -frtti IN ALL MODULES THAT USE IT. </code></pre> <p>WARNING: END OF IMPORTANT CAVEAT</p> <p>"stlport_shared" is preferred if you have several shared libraries in your project that use the C++ STL, because it avoids duplication of functions and more importantly of global variables (e.g. std::cout) in each one of them, which can have surprising results.</p> <p>On the other hand, you will have to load it explicitely when starting your application, as in the following example:</p> <pre><code> static { System.loadLibrary("stlport_shared"); System.loadLibrary("foo"); System.loadLibrary("bar"); } </code></pre> <p>Where both "libfoo.so" and "libbar.so" depend on "libstlport_shared.so".</p> <p>Note that the shared library's name if "libstlport_shared.so" to avoid naming conflicts with certain Android system images which include a system-level libstlport.so (which happens to not be ABI-stable and cannot be used from NDK-generated machine code).</p> <p>"stlport_static" is preferred if you have only one shared library in your project: only the STL functions and variables you actually need will be linked to your machine code, reducing its code size, and you won't need to load the dynamic stlport_shared at startup.</p> <h2>IV. STLport-specific issues:</h2> <p>This NDK provides prebuilt static and shared libraries for STLport, but you can force it to be rebuilt from sources by defining the following in your environment or your Application.mk before building:</p> <pre><code>STLPORT_FORCE_REBUILD := true </code></pre> <p>STLport is licensed under a BSD-style open-source license. See sources/cxx-stl/stlport/README for more details about the library.</p> <h2>V. Future Plans:</h2> <ul> <li>Make STLport compatible with C++ exceptions and RTTI</li> <li>Full GNU libstdc++ support</li> <li>uSTL support?</li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload