How to Compile Qt(.cpp) file from command prompt

From Nokia Developer Wiki
Jump to: navigation, search

This article shows how to compile a Qt application from the command prompt. There are additional instructions in the Qt Reference.

Article Metadata
Tested with
Devices(s): Emulator
Platform(s): S60 3rd Edition FP1, S60 3rd Edition FP2, S60 5th Edition
Keywords: Qmake
Created: james1980 (05 Jan 2009)
Last edited: hamishwillee (24 Jul 2012)


  • Download and install the Qt SDK

Procedure for compiling

  • Open the Command prompt window for your target SDK from the Windows start bar, for example: Start | Qt SDK | Symbian~^3 | Qt 4.7.1 for Symbian^3 Command Prompt
  • Using a basic command navigate to the directory that contains your .cpp file.
 c:\> cd qt\examples\formlayout
  • Give the command shown below. This command will automatically generate project file(.pro file)
 c:\qt\examples\formlayout\> qmake -project
  • If you use qmake to build your projects, it include the QtCore and QtGui by default. However, if you want to add only Qtcore module, add the folloing line to your .pro file. This is normally used in console application.
 QT -= gui
  • To add extra module like network,webkit,phonon etc. add following line to your .pro file
 QT += network
  • You can also add this line while creating a project file using qmake command.
 c:\qt\examples\formlayout\> qmake -project QT+=network
  • Now give the command to generate various make file
 c:\qt\examples\formlayout\> qmake
  • Now give the following command
 c:\qt\examples\formlayout\> make debug-gcce
  • Note that the above command is actually a combination of two Symbian build toolchain commands:
 bldmake bldfiles 
 abld build gcce udeb

Creating a sisx file

  • Following commands are use to create a self signed sis for the device.
 make debug-gcce
 createpackage -i examplename_gcce-udeb.pkg
This page was last modified on 24 July 2012, at 05:07.
229 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.