Home - Forums - Documentation - Gallery - Bugs


Eclipse for Linux IDE configuration for use with Crystal Space

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

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

Note: This tutprial is in pre-alpha stage. It is incomplete. The screen-shots will be added to this page later.

Creating the project

Open Eclipse. From menu run File->New->Project. This will open Project creation dialogue. Select C++->Managed C++ Project. If your project is managed Eclipse will write a makefile for you. Click Next. Now you can name your project. If the project directory is not empty Eclipse will import existing files. In the next step tell Eclipse that your target is executable, pick build type and configure some advanced options. Now write your code (or just import existing source)

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'

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 Properties:

Select C/C++ from the list on the left. New list appears on the right side. Click GCC C++ Compiler->Miscellaneous. Add `cs-config --cxxflags` to "other flags". So far so good. Now click GCC C Compiler->Miscellaneous and add `cs-config --cflags`. Go to GCC C++ Linker. By default Eclipse provides linker parameters in the wrong order, you need to fix this. Remove the contents of "Command line pattern" field and type


Now you have flags at the end of your command line and need to provide the flags. Go to Linker->Miscellaneous and add `cs-config --libs` to the linker flags field.

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.


If you build now you will, probably, get a nicely working executable file.


I failed to run the executable from GUI, but it worked when executed from shell. I did not find any better workarounds for this problem.

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.

Useless information

Written by Jan Hendriks (DaHoC, DaHoC3150@gmail.com) Also written by Oktal and Muxecoid

Last major update 26.05.2007, Using Eclipse 3.2.0, Crystal Space 1.0.1

| Article | Discussion | View source | History |