OGRE 1.x C++ starter template for easy prototyping on Ubuntu 20.04 LTS with Scons build system. There are just three easy steps setup, clone and build & run and you are ready to start prototyping.
if you are not yet familiar with SCons watch out scons-starter tutorial
Normally the easiest way to start with OGRE is from official package (libogre-1.12-dev), but I've found that it is broken in Ubuntu 20.04 LTS (user input is not working at all). Luckily for us the solution is dead simple. We are going to build the library by are own!
- install dependencies with
sudo apt install libxaw7-dev libsdl2-dev libgles2-mesa-dev libxt-dev libzzip-dev libfreetype-dev scons g++ pkg-config gitcommand.
tip: you can skip
libgles2-mesa-devpackage if you do not need OpenGL ES2/3 renderer support
- download source code from OGRE repository with
git clone https://github.com/OGRECave/ogre.gitcommand
- checkout newest 1.x version with
cd ogre
git checkout -b v1.12.9 v1.12.9 currently the newest available 1.x version is 1.12.9
commands.
- configure OGRE with
mkdir build
cd build
cmake -DOGRE_BUILD_RENDERSYSTEM_GLES2=TRUE -DOGRE_BUILD_PLUGIN_ASSIMP=FALSE ..
tip: omit
-DOGRE_BUILD_RENDERSYSTEM_GLES2=TRUEin case you do not need OpenGL ES2/3 renderer support
note: in case you have installed
libassimp-devpackage, building OGRE will fail with dependency issues (No rule to make target 'Dependencies/lib/IrrXML.lib', needed by 'lib/Codec_Assimp.so.1.12.9'), that is why-DOGRE_BUILD_PLUGIN_ASSIMP=FALSEconfiguration option used
- build OGRE with
make -j4command.
- install OGRE with
sudo make installcommand.
note: the library is installed in
/usr/localdirectory
- configure dynamic linker run-time bindings with
sudo ldconfigcommand, otherwise system can't see newly installed libraries and you will end up with cannot open shared object file ... complains after you try run OGRE application.
- create link for
libzzip.so.13which is installed aslibzzip-0.so.13in Ubuntu 20.04 LTS with
cd /usr/lib/x86_64-linux-gnu
sudo ln -s libzzip-0.so.13 libzzip.so.13commands.
tip: optionally you can also install OGRE documentation as
ogre-1.12-docand tools asogre-1.12-toolspackages
Clone starter project repository with
git clone https://github.com/sansajn/ogre-linux-starter.gitcommand and delete ogre-linux-starter/.git directory after cloning finished.
To start a build process go to ogre-linux-starter and run scons with
cd ogre-linux-starter
sconscommands.
use
-jNoption to speed up whole build process likescons -j4andscons -cfor cleaning the project directory orscons --helpfor further help
Scons will create ./hello as a result. So
./hellowill run the sample app. In my case I can now see
You are done, feel free to modify ...
tip: there is great jump-in tutorial for OGRE there
Adam Hlavatovic
