This article demonstrates how to create and use shared library DLLs with Qt on the Symbian platform. It is accompanied by a simple code example that populates a label widget with a random number from a DLL when a button is pressed.
Shared library DLLs are a common paradigm on most operating systems; re-usable functionality is stored in a shared library that executable code can link against at build time and load at runtime. As the functionality in the DLL is shared by several clients the overall code size, memory usage and maintenance are reduced.
Shared library DLLs are created and used in much the same way on the Symbian platform as on other platforms. However there are a number of platform specific issues that developers need to be aware of:
Symbian uses link by ordinal exclusively: Shared library DLLs provide a fixed API with a number of entry points. On some platforms entry points can be referenced either by name or by ordinal number - on Symbian you can only use the ordinal number (the names are stripped out of the DLL in order to reduce code size). In practice this means that we will need to create a .def file to ensure that the ordinals are kept in the same order between releases and thereby maintain binary compatibility.
DLLs may need Platform security capabilities.
DLLs need a unique identifier (UID)
DLLs that have writeable static data are not fully supported by the free GCCE 3.4.3 compiler. For more information see Symbian frameworks .
This article walks you through the steps for creating, using and packaging a shared DLL. At the end of the article there is an overview of the code example.
Tip: While shared library DLLs are recommended when library code is going to be shared by many clients, there are other options that may be more suitable for application developers.
Important: © 2010 Symbian Foundation Limited. This document is licensed under the Creative Commons Attribution-Share Alike 2.0 license. See http://creativecommons.org/licenses/by-sa/2.0/legalcode for the full terms of the license.
This article was originally hosted on the Symbian Foundation developer wiki.