Namespaces
Variants
Actions

Building a library project in Qt using Qt Creator

Jump to: navigation, search

This article shows how to create a shared DLL project using Qt Creator. The instructions include the extra step required for the Symbian platform of freezing the API.

Article Metadata

Tested with
SDK: Qt SDK 1.1 (Qt Creator 2.2.1)

Compatibility
Platform(s): Symbian^1 and later

Article
Keywords: freeze library def
Created: favoritas37 (29 Jul 2011)
Last edited: hamishwillee (13 Jun 2012)

Steps

  1. Create a new library project in Qt Creator as shown in the image below. Qt Creator generates all the needed files.
    CreatingNewLibraryProjectQtCreator.jpg
  2. When compiling the project for Symbian, you will get a warning Frozen .def file \QtSDKProjects\eabi\testLibrary.def not found - project not frozen. This warning reminds you that you need to freeze the exports before release, so as to ensure that subsequent releases are backwards compatible.
Note.png
Note: The Symbian Platform uses "link by ordinal" (rather than "link by name"). In order to ensure that different versions of the library are compatible, functions have to be exported from the same ordinal position. We achieve this by storing ("freezing") the ordinal position of each function in a .def file, and using this file to define the function position each time the DLL is rebuilt.

Freezing a project

Tip.png
Tip: Unfortunately we can't freeze the API from Qt Creator. Instead we need to open a command prompt and call qmake directly
  1. To begin with, we need to open a command prompt whose environment will be configured for our target platform. For example, to do this on Windows 7 targeting Symbian^3 Qt 4.7.3, you can go under: "Start" -> "All programs" -> "Qt SDK" -> "Symbian^3 Qt 4.7.3" and open Qt 4.7.3 for Symbian^3 Command Prompt
    ConfiguredCommandPromptChangeDirectory.jpg
  2. Once we have the Command Prompt, we change our current working directory to match the directory of the project we need to freeze.
  3. Then it's time to freeze the project. Type the following command:
    abld freeze gcce

If the above operation completed without errors you are done!

References

This page was last modified on 13 June 2012, at 13:51.
212 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved