The version mentioned here is a little low, but it applies to Ubuntu11.10 + Ogre1.8. For Ubuntu9.10 and later versions: Install the compiler and Configuration tool: sudoapt-getinstallbuild-esstialautomakelibto install required dependencies: sudoapt-getinstalllibfreetype6-devlibfreeimage-devlibzzip-d
The version mentioned here is a little low, but it is applicable to Ubuntu 11.10 + Ogre1.8.
For Ubuntu 9.10 and later versions:
Install the compiler and Configuration tool:
Sudo apt-get install build-essential automake libto
Required dependencies for installation:
Sudo apt-get install libfreetype6-dev libfreeimage-dev libzzip-dev libxrandroid-dev libxaw7-dev freeglut3-dev libgl1-mesa-dev libglu1-mesa-dev
If the header file is missing during Ogre compilation, try to add the following libraries and upgrade the libraries listed below:
. Libxt-dev
Libpng3-dev
Opengl may use libglew1.5-dev rather than freeglut3-dev. Whether libxt-dev and libpng3-dev are required is not very sure (it is best to install it together ).
Install non-strict dependencies:
Sudo apt-get install nvidia-cg-toolkit libois-dev libboost-thread-dev
Install optional dependencies:
Sudo apt-get install doxygen graphviz libcppunit-dev
Before you try to use CMake to compile Ogre, make sure that you have prepared the previous preparations!
What to do next:
1. Download the source code of Ogre from the guangfang website (the latest version is 1.7.2. If you upgrade it, download the latest version );
2. decompress:
Tar xjf ogre_src_v1-7-2.tar.bz2
3. Enter the extracted root directory;
Cd ogre_src_v1-7-2
4. Create a compiled directory:
Mkdir build
5. Go to the build directory:
Cd build
6. Compile with the cmake command:
Cmake ..
(The purpose is to generate all the compiled files in the build folder. If the compilation fails, you only need to delete the build folder and re-compile it)
You can view a large number of CMake documents, add a lot of compilation options when executing the compilation, and use CMake for compilation under more background conditions. Note: OGRE_CONFIG_THREADS = 1 is not supported in linux.
7. If the CMake result looks good, compile Ogre:
Make-j2
-J2 indicates the number of compilation threads. It is equal to the number of cpu cores on your computer. For example,-j2 corresponds to dual-core,-j4 corresponds to quad-core...
8. After the compilation is successful, you can install Ogre in your system (installed in the default directory,/usr/local ):
Sudo make install
After completing the steps above, even if the Ogre is installed, run the built-in example.
Run in the build/bin directory:
./SampleBrowser
The running result is as follows (the Ogre version here is a v1-8-0 ):