Home - Forums - Documentation - Gallery - Bugs


KDevelop IDE configuration for use with Crystal Space and CEL

In this short tutorial I will guide you through some basic steps in order to create a Crystal Space application using the KDevelop IDE.

First of all, you need to have a compiled and working version of Crystal Space, see "Building and Installing Crystal Space".

Note: The screenshots embedded on this page are reduced versions. Click on them for the full resolution image.

Creating the application template

Now open KDevelop C/C++ IDE and click on Project -> New.

A wizard appears and you should see a screen similar to this:

Now, as shown in the screenshot, choose C++ and Simple Hello world program.

In the properties area, enter your preferred application name and a location to store the source and additional files in. The path can be located anywhere you like and does not have to be in the Crystal Space source directory. Just make sure you have sufficient r/w permissions and drive space available.

Author, version control and copyright information

The next step of the wizard takes you to this screen:

Here you can enter your name, e-mail and the version and license type of your application.

In the next step you can optionally set up a version control system, which is useful for larger projects. I will not go into detail here, since this is not part of this tutorial:

The next two screens show the templates for the .h and .cpp source files, you may want to keep the copyright stuff in there:

The important part

So much for warm-up, lets get down to the nitty-gritty. A screen similar to the one below appears, now open the project properties page by clicking Project and Project Options:

A new window pops up where you can configure several project-specific settings, you can take a look through them to make sure everything is in order.

Click on Configure Options and enter a new configuration name, here it is CrystalSpace. Now, important is to click on 'Add' before actually entering anything in the below fields.

Now you have created a new configuration profile and you can enter the Crystal-Space specific settings as shown:

Please note: If you did not install Crystal Space and the Crystal Space build directory is not in the system $PATH variable, you have to specify the location of the 'cs-config' file explicitly. This means that instead of just entering cs-config you have to state the location of the 'cs-config' in addition, for example the Crystal Space build directory. If you registered the $CRYSTAL-variable system-wide this can be done by substitution of every `cs-config` with `$CRYSTAL/cs-config`. If you did not, you really have to enter the path to the build directory of Crystal Space, e.g. `/mnt/g/CS/cs-config`. However, it is also possible, but not recommended to copy the cs-config file into the top directory of your new project. For development version of CS, the cs-config-file may be named cs-config-1.1 or similar.

Also note another thing that can be a source of errors: The character that encloses cs-config is an "opening single quote" ` (ASCII nr. 96) and not '! Ensure you do not forget these characters, otherwise you will get a compiler error message later.

Basically you can copy-paste (and if needed, edit) the following:

KDevelop Settings for CS and CEL applications
CrystalSpace Application CrystalEntityLayer Application
CPPFLAGS: -I `$CRYSTAL/cs-config --includedir` -I`$CRYSTAL/cs-config --includedir` -I`$CEL/cel-config --includedir`
LDFLAGS: `$CRYSTAL/cs-config --libs crystalspace` `$CRYSTAL/cs-config --libs crystalspace` `$CEL/cel-config --lflags`

And at the next tab (C tab):

CrystalSpace Application CrystalEntityLayer Application
CFLAGS: `$CRYSTAL/cs-config --cflags` `$CRYSTAL/cs-config --cflags` `$CEL/cel-config --cflags`

And at the C++ tab:

CrystalSpace Application CrystalEntityLayer Application
CXXFLAGS: `$CRYSTAL/cs-config --cxxflags` `$CRYSTAL/cs-config --cxxflags` `$CEL/cel-config --cxxflags`

Runtime options

In the 'run' options tab on the left hand side, you can enter some arguments to the program, e.g. '-mode=1280x1024 -fs' or '-bugplug'

Let your friends run

Now let's see if you're lucky. Click Build and Run automake & friends

Before you can start, you have to insert the obligatory lines for Crystal-Space applications in your .cpp file:

#include <crystalspace.h> (in the screenshot: <cssysdef.h> because of older version of Crystal Space) and


In addition you may need to modify the signature of the main function the following way:

That's a Simple One

For testing purposes, you can try out the 'simple1.cpp' and 'simple1.h' source files from the Crystal Space code tree. These files can be found within the Crystal Space source code tree at the following location: 'CS/apps/tutorial/simple1'

Have fun!

Now you should be able to compile your application and make some shiny game with Crystal Space!

That's all there is to it. If you have trouble, you are welcome to check out the Crystal Space IRC-Channel for help or drop me a note.

Useless information

Written by Jan Hendriks (DaHoC, DaHoC3150 [@] gmail.com)

Last major update 10.08.2007, Using KDevelop 3.4.1, Crystal Space 1.3, CEL 1.3 (both svn trunk version)

| Article | Discussion | View source | History |