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

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

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

## 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
```
``` 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
```