You Are Here:

Community: Wiki

This page was last modified on 28 September 2009, at 04:13.

Static Library

From Forum Nokia Wiki

Static Library Usage in Symbian OS

Symbian build tools provide the possibility to link objects into a lib file, which can be linked to other sources using the library’s headers. The use of static libraries should be seen as an option in case where no DLL is required, but modularization and low-level version control should be accomplished. As an advantage, the source files need not be given in cases where an engine is sold to developers. Also when static libraries are used from the start of a project, later it is easy to convert the application to make use of static DLL framework.

Creating a Static Library

Symbian OS has target type lib defining that the compiled object codes should be linked into a static library. As with other target types (for example, APP and DLL), this will set UID1 correctly, and no other UID definitions are needed.

Here is a sample MMP file:

// StaticLibEngExample.mmp
TARGET StaticLibEng.lib
TARGETTYPE lib
 
SOURCEPATH ..\src
SOURCE StaticLibEng.cpp
 
USERINCLUDE ..\inc
SYSTEMINCLUDE \epoc32\include

As a static library is just a collection of objects, it does not require to be linked against any import libraries. Hence, in the MMP file of the static library, LIBRARY and SYSTEMLIBRARY statements should not be used. Instead, the user of the static library is responsible for linking against all the required import libraries.

Using global and writable static data (WSD) in static libraries is possible but not recommended as it increases memory consumption and has limited support in the emulator. Furthermore, WSD may cause problems if the library is later converted into a static interface DLL.

Using Static Library

The user of the static library should list the static library with the statement STATICLIBRARY in its MMP file. The user of the static library must list all the dlls used by the static library in its MMP file using LIBRARY and/or SYSTEMLIBRARY statements.

Source Code

Full example: Eldtobhu(StaticLib).zip

Resources

Symbian OS: Platform-Independent Engine Development v1.0

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fFileE3aMicrokernelE5fArchitectureE2eGIFX qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqfntypeZWikiContentQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZtypeQUqfntypeZWikiContentQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqfntypeZWikiContentQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ