Compiling Irrlicht in Ubuntu

Dec 14th, 2009 by mcasperson

This tutorial shows you how to get the Irrlicht 3D engine compiled in Ubuntu.

Download and extract Irrlicht from the website. The packing includes the library and demo executables for Windows x86 only, so to get the engine up an running on Linux you will have to compile it.

First you will need to install a few tools and libraries that are not included with Ubuntu by default. These can all be installed with the one command:

sudo apt-get -y install build-essential xserver-xorg-dev x11proto-xf86vidmode-dev libxxf86vm-dev mesa-common-dev libgl1-mesa-dev libglu1-mesa-dev libxext-dev

If you try and compile the source at this point you may get an error message that says:

/usr/bin/ld: cannot find -lXxf86vm

The libXxf86vm file does exist in Ubuntu, it is just not linked up properly. To fix that issue use the following command:

ln -s /usr/lib/libXxf86vm.so.1 /usr/lib/libXxf86vm.so

At this point you should have everything you need. Open up a terminal window, go to the source/Irrlicht subdirectory, and use the following command:

make

This will compile the Irrlicht library, which is used by all Irrlicht applications and demos. To compile the demos, go to the examples directory and use the following command:

./buildAllExamples.sh

Now in the bin/Linux directory you should see a number of executable files.

To run a demo, use a command like the following:

./12.TerrainRendering

The 3D demo should now run.

The demos supplied with Irrlicht know to reference the header and library files directly from the Irrlicht SDK. However, when creating your own applications typically you will want to copy the header files to the /usr/local/include directory, and the library file to the /usr/local/lib. In theory the make install command would normally do this for you, but for Irrlicht (up to version 1.6 at least) the makefile is not setup correctly. The following commands copy these files to their standard locations:

sudo cp -r include/* /usr/local/include

sudo cp lib/Linux/libIrrlicht.a /usr/local/lib

mcasperson

Written by mcasperson

Rate this Article:

Rating: 3.0/5 (2 votes cast)

Add new comment

* You must be logged in order to leave comments, please Sign in or join us.

Comments

No comments yet, be the first to comment on this article.

mcasperson has 97 articles online

Related Content