Skip to main content
QtCreator Logo
Setting Up An Application With QtCreator


Introduction

This set of instructions will walk you through setting up a QtCreator C++ project from scratch.

When you have finished this tutorial you will be able to compile a working Ogre Application and you will be ready to start the Basic Tutorials.

Prerequisites

Get QtCreator from qt-project.org.
Get the stable version that fits your setup.

New Project

Click New Project in the start screen, and choose Other Project - Empty project.
1 - Setting Up an Application - QtCreator

Give it a name and a place:
2 - Setting Up an Application - QtCreator

Add files: (Tip: Move your cpp and h-files to inside the Qt project folder before you do this!)
3 - Setting Up an Application - QtCreator

Files added:
4 - Setting Up an Application - QtCreator

Options:
5 - Setting Up an Application - QtCreator

Qt4 Settings: (Tip: In Qt 5 this is called "Build & Run". If you have installed Visual Studio before you installed the Visual Studio Qt 5-version, all this should already be correct set up., so you do not have to do anything here.)
6 - Setting Up an Application - QtCreator

Edit project file:
7 - Setting Up an Application - QtCreator

Copy to clipboard
TEMPLATE = app TARGET = OgreQtProject DEFINES -= UNICODE CONFIG -= qt unix { # You may need to change this include directory INCLUDEPATH += /usr/include/OGRE CONFIG += link_pkgconfig PKGCONFIG += OGRE } win32 { LIBS *= user32.lib LIBS += -L$(OGRE_HOME)\\boost\\lib release:LIBS += -L$(OGRE_HOME)\\lib\\release debug:LIBS += -L$(OGRE_HOME)\\lib\\debug INCLUDEPATH += $(OGRE_HOME)\\include INCLUDEPATH += $(OGRE_HOME)\\include\\OIS INCLUDEPATH += $(OGRE_HOME)\\include\\OGRE INCLUDEPATH += $(OGRE_HOME)\\boost # If you are using Ogre 1.9 also include the following line: # INCLUDEPATH += $(OGRE_HOME)\\include\\OGRE\\Overlay } debug { TARGET = $$join(TARGET,,,d) LIBS *= -lOgreMain_d -lOIS_d # If you are using Ogre 1.9 also include -lOgreOverlay_d, like this: # LIBS *= -lOgreMain_d -lOIS_d -lOgreOverlay_d } release { LIBS *= -lOgreMain -lOIS # If you are using Ogre 1.9 also include -lOgreOverlay, like this: # LIBS *= -lOgreMain -lOIS -lOgreOverlay } HEADERS += \ TutorialApplication.h \ BaseApplication.h SOURCES += \ TutorialApplication.cpp \ BaseApplication.cpp


Build All:
8 - Setting Up an Application - QtCreator

Build Settings:

Note: In the Release configuration, go to
"Build Steps -> qmake", press "Details" and add

Copy to clipboard
"CONFIG-=debug" "CONFIG+=release"

to the "Additional arguments:"

Then to this:
9 - Setting Up an Application - QtCreator

Custom Process Step settings: - do this for both the Debug and Release configuration:
Note: You can also use environment variables here, in %-signs. Like this:

Copy to clipboard
C:\Windows\System32\cmd.exe /c copy debug\OgreQtProjectd.exe %OGRE_HOME%\bin\debug

and you probably want to leave the Working directory to the defaul value of %{buildDir}.
10 - Setting Up an Application - QtCreator

Run Settings - must make one for debug, one for release:
11 - Setting Up an Application - QtCreator

New Run Configuration:
Note: You can also use environment variables here, in %-signs. Like this:

Copy to clipboard
Executable: OgreQtProjectd.exe Working directory: %OGRE_HOME%\bin\debug

12 - Setting Up an Application - QtCreator

Tutorial Framework

Tutorial Framework:
vc10step3.png
Download the Ogre Wiki Tutorial Framework here:

 Plugin disabled
Plugin attach cannot be executed.

Project Configuration