My ogre 2.1 setup experience (linux)
Posted: Fri Feb 02, 2018 12:36 pm
I want to share here my experience of building, assembling and setting up an OGRE 2.1 and related libraries for my old project, including editing code and running the application. On Linux system.
As a goal - this is possible help to other users, as well as a presentation for developers how this process takes place for ordinary user. In addition, if I would have problems, I hope to get help from more experienced users or developers in this topic.
I suppose that this process will occur by adding new posts while progress.
My last working copy uses OGRE 1.9 and other libraries released at least until 2016.
I will build it on fresh(clean) Linux Debian 9 "Stretch". The system has installed nvidia-drivers and xfce desktop environment.
Well, let's get started.
Setup experience. Part 1
The first thing I did was go to the ogre download page. By reference "What version to choose?" I read about the advice to port first to 2.0, but neglected it and decided to set immediately 2.1. Read again Ogre 2.1 FAQ.
Downloaded the latest version 2.1 (Commit 8c5a30d) from repository. After reading the article "Building Ogre Guide" from download page, I tried to make the steps in article:
apt-get install cmake-gui
apt-get install libgles2-mesa-dev libxt-dev libxaw7-dev nvidia-cg-toolkit libsdl2-dev doxygen
I used the cmake graphical interface, and chose to generate simple "Unix Makefiles". But I could not advance beyond the CMake configuration, because there was missing FREETYPE_FT2BUILD_INCLUDE_DIR. Later I realized that I need to install libfreetype6-dev also (and not just libfreetype6). It seems elementary, by article, but it took me 2 hours. I was hit, that I did not understand what was meant by the entry "By default ogre will build the essential dependencies automatically when you run cmake the first time" and did not find subfolder "Dependencies". Also "run cmake the first time" I did not succeed because there was no freetype.
By the way, the version of libfreetype6-2.8.1-1 I have is from the test repository, because there is new quality hinting for the desktop fonts. Thus, "non-standard" for Stretch, I only have these libraries: libfreetype6-dev-2.8.1-1, libpng-dev-1.6.34-1, libpng-tools-1.6.34-1
apt-get install libfreetype6-dev
(For me: apt -t testing install libfreetype6-dev)
Now the log looked with warnings, but the makefile was generated.
At this point, I decided to leave everything as default, and I started building the library:
cd ~/rain/dev/libs/ogre-v2.1-02.02.18/build/
make clean
make -j 8
Buiding log, with many gcc warnings.
Remembered that I do not have OIS.
While dealing with the freetype, I found another page, where it is recommended to install the above packages:
apt-get install build-essential automake libtool libfreetype6-dev libfreeimage-dev libzzip-dev libxrandr-dev libxaw7-dev freeglut3-dev libgl1-mesa-dev libglu1-mesa-dev nvidia-cg-toolkit libois-dev libboost-thread-dev doxygen graphviz libcppunit-dev libxt-dev
I decided to install everything, and rebuild OGRE. CMake log, already without any warnings. And build log.
After this, I tried to enable the OGRE_BUILD_PLUGIN_CG, but the build failed: configuration and build errors.
Left everything by default, rebuild, and moved on.
The next step is downloading MyGUI. Was downloaded the latest version(98ba6dc) mygui from "ogre2.1" branch.
Using instructions from the this page, i set OGRE_SOURCE_DIR and OGRE_BUILD, but got configuration errors. Trying to set different other options, I found out that need specify OGRE_LIBRARIES (as patch to build/libs). Configuration now looks ok, but while building can not find OgreBuildSettings.h.
The search how to correctly add in includes OgreBuildSettings.h success has not brought. Found only one thing with a fun answer. So just created a symbolic link. Crutch one.
cd ~/rain/dev/libs/ogre-v2.1-02.02.18
ln -s ../../build/include/OgreBuildSettings.h OgreMain/include/OgreBuildSettings.h
Well, the file was found, now the next error: 'class Ogre::Viewport' has no member named 'setClearEveryFrame' etc.
To be continued.
As a goal - this is possible help to other users, as well as a presentation for developers how this process takes place for ordinary user. In addition, if I would have problems, I hope to get help from more experienced users or developers in this topic.
I suppose that this process will occur by adding new posts while progress.
My last working copy uses OGRE 1.9 and other libraries released at least until 2016.
I will build it on fresh(clean) Linux Debian 9 "Stretch". The system has installed nvidia-drivers and xfce desktop environment.
Well, let's get started.
Setup experience. Part 1
The first thing I did was go to the ogre download page. By reference "What version to choose?" I read about the advice to port first to 2.0, but neglected it and decided to set immediately 2.1. Read again Ogre 2.1 FAQ.
Downloaded the latest version 2.1 (Commit 8c5a30d) from repository. After reading the article "Building Ogre Guide" from download page, I tried to make the steps in article:
apt-get install cmake-gui
apt-get install libgles2-mesa-dev libxt-dev libxaw7-dev nvidia-cg-toolkit libsdl2-dev doxygen
I used the cmake graphical interface, and chose to generate simple "Unix Makefiles". But I could not advance beyond the CMake configuration, because there was missing FREETYPE_FT2BUILD_INCLUDE_DIR. Later I realized that I need to install libfreetype6-dev also (and not just libfreetype6). It seems elementary, by article, but it took me 2 hours. I was hit, that I did not understand what was meant by the entry "By default ogre will build the essential dependencies automatically when you run cmake the first time" and did not find subfolder "Dependencies". Also "run cmake the first time" I did not succeed because there was no freetype.
By the way, the version of libfreetype6-2.8.1-1 I have is from the test repository, because there is new quality hinting for the desktop fonts. Thus, "non-standard" for Stretch, I only have these libraries: libfreetype6-dev-2.8.1-1, libpng-dev-1.6.34-1, libpng-tools-1.6.34-1
apt-get install libfreetype6-dev
(For me: apt -t testing install libfreetype6-dev)
Now the log looked with warnings, but the makefile was generated.
At this point, I decided to leave everything as default, and I started building the library:
cd ~/rain/dev/libs/ogre-v2.1-02.02.18/build/
make clean
make -j 8
Buiding log, with many gcc warnings.
Remembered that I do not have OIS.
While dealing with the freetype, I found another page, where it is recommended to install the above packages:
apt-get install build-essential automake libtool libfreetype6-dev libfreeimage-dev libzzip-dev libxrandr-dev libxaw7-dev freeglut3-dev libgl1-mesa-dev libglu1-mesa-dev nvidia-cg-toolkit libois-dev libboost-thread-dev doxygen graphviz libcppunit-dev libxt-dev
I decided to install everything, and rebuild OGRE. CMake log, already without any warnings. And build log.
After this, I tried to enable the OGRE_BUILD_PLUGIN_CG, but the build failed: configuration and build errors.
Left everything by default, rebuild, and moved on.
The next step is downloading MyGUI. Was downloaded the latest version(98ba6dc) mygui from "ogre2.1" branch.
Using instructions from the this page, i set OGRE_SOURCE_DIR and OGRE_BUILD, but got configuration errors. Trying to set different other options, I found out that need specify OGRE_LIBRARIES (as patch to build/libs). Configuration now looks ok, but while building can not find OgreBuildSettings.h.
The search how to correctly add in includes OgreBuildSettings.h success has not brought. Found only one thing with a fun answer. So just created a symbolic link. Crutch one.
cd ~/rain/dev/libs/ogre-v2.1-02.02.18
ln -s ../../build/include/OgreBuildSettings.h OgreMain/include/OgreBuildSettings.h
Well, the file was found, now the next error: 'class Ogre::Viewport' has no member named 'setClearEveryFrame' etc.
To be continued.