OpenGE stands for Open Game Engine, a free and open source game engine with educational purposes in mind.
The following libraries must be present in your system to be able to compile OpenGE, the rest are included in the repository and will be compiled along the engine.
Libraries:
Install Brew (I can't find a reason you don't already have it). You can install all the libraries from brew like this:
brew install SDL2 SDL2_Image SDL2_TTF Boost lua luabind
The libraries we need to install in the system are:
If they are present in your distro repositories install from there or if you feel brave enough compile them your self. Since the versions in the repositories are likely to be very old or outdated the following guide will try to get you the most recent version of each library.
Boost:
sudo apt-get install build-essential g++ python-dev autotools-dev libicu-dev libbz2-dev
./bootstrap.sh --prefix=/usr/local
sudo ./b2 --with=all install
. This will take a while (15~30 minutes).lua and LuaBind:
sudo apt-get install lua5.1 lua5.1-policy-dev
sudo apt-get install libluabind-dev
OpenGL:
sudo apt-get install mesa-common-dev
sudo apt-get install libgl1-mesa-dev
SDL2:
./configure
make
sudo make install
SDL2_Image:
sudo apt-get install libpng12-dev libjpeg-dev libtiff4-dev libwebp-dev
./configure
sudo make install
SDL2_TTF:
sudo apt-get install libfreetype6-dev
./configure
make
sudo make install
OpenGE also uses C++11 features, so you need a compiler compatible with it.
C++11:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.8 g++-4.8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.6
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8
sudo update-alternatives --config gcc
and select the 4.8 option.At the time of the creation of this guide GCC have a bug where the use of #elif
differs from #else #if
so the project fails to compile luabind. Until thise parsing error is fixed in a newer version of GCC some tweaking in LuaBind files is necessary to make it work. The following list details the files and line of code where #elif
must be changed for an #else
and a nested #if
:
¡IMPORTANT! Remeber to add another #endif
at the end of the file since we added a new #if
. To clarify, we are changin from this:
#if (...)
#elif (...)
#endif
To this:
#if (...)
#else
#if (...)
#endif
#endif
If you, like me, find this bug pretty anoying feel free to email the LuaBind guys to change those lines of code and the GCC devs to fix the parser of GCC 4.8. In the mean time this is the only workaround in Linux :-(