This is a tutorial step by step to how develop Ogre 1.7.1 in linux Ubuntu 10.04.
Tutorial All made in ubuntu 10.04, and with Ogre 1.7.1 source
Notes: 1 - When you see "username", change for your linux user name.
2 - Sorry for any English mistake.
I - Install Compiler and Configuration tools
sudo apt-get install build-essential automake libtool cmake-gui
II - Install Ogre Dependencies
sudo apt-get install libois-dev libfreeimage-dev libfreetype6-dev libzzip-dev libxaw7-dev libglew1.5-dev libxrandr-dev
III - Install other Ogre Packages (optional)
sudo apt-get install doxygen graphviz nvidia-cg-toolkit libboost-dev libcppunit-dev
IV - Install Cegui Dependencies (optional)
sudo apt-get install libpcre++-dev libwxgtk2.8-dev libjpeg62-dev
sudo apt-get install libpng3-dev
V - Cegui other Packages (optional)
sudo apt-get install doxygen graphviz
VI - Create Folder structure, like this:
Create a folder in /home/username/dev
Create a folder in /home/username/dev/ogre
Create a folder in /home/username/dev/ogre_build
VII - Download Ogre source
http://www.ogre3d.org/download/source
(OGRE 1.7.1 Source for Linux / OSX)
extract files into /home/username/dev/ogre
VIII - Compiling Ogre
Open cmake-gui.
where is the source code: /home/username/dev/ogre
where to build the binaries: /home/username/dev/ogre_build
Once you have selected the folder click configure. In the new window that appears leave the setting at default. It should look like this:
unix makefiles
use default native compilers
Once you are done with that window just click finish. Check all lines, except ogre_static.
Once you're done click configure again then on generate. Now you can close the window. Go back to the terminal and enter this:
cd /home/username/dev/ogre_build
make
this will take a while.
sudo make install
sudo ldconfig
IX - Install Ode (optional)
Get the latest source from http://sourceforge.net/projects/opende/files/. Extract it to "dev" folder so it look like this:
/home/username/dev/ode-0.11.1
Now open a terminal and go to that source folder like so:
cd /home/username/dev/ode-0.11.1
./configure
make
sudo make install
X - Instal Silly (optional)
Dependences needed by the editors. Get the latest source from http://www.cegui.org.uk/wiki/index.php/ ... oads_0.1.0. Extract it to "dev" folder so it look like this:
/home/username/dev/SILLY-0.1.0
Now open a terminal and do:
cd /home/username/dev/SILLY-0.1.0
./configure
make
sudo make install
XI - Install Cegui (optional)
Get the latest source http://www.cegui.org.uk/wiki/index.php/ ... oads_0.7.1. Extract it to the "dev" folder so it look like this:
/home/username/dev/CEGUI-0.7.1
Now open a terminal and do:
cd /home/username/dev/CEGUI-0.7.1
./bootstrap
./configure
make
sudo make install
sudo ldconfig
note: if you installed doxygen and graphviz you can make html to generate html documentation.
XII - Install Celayereditor (optional)
Get the latest source from http://www.cegui.org.uk/wiki/index.php/ ... oads_0.7.1. Extract it to the "dev" folder so it look like this:
/home/username/dev/CELayoutEditor-0.7.1
Now open a terminal and do:
cd /home/username/dev/CELayoutEditor-0.7.1
./configure
make
sudo make install
Now you have to select the datafiles folder from the source folder when the editor start for the first time.
/home/username/dev/CELayoutEditor-0.7.1/datafiles
Now you will need to copy to file to datafiles/fonts folder from the datafiles/font folder of cegui source. you need to copy this two file:
/home/username/dev/CEGUI-0.7.1/datafiles/fonts/dejavusans.ttf
/home/username/dev/CEGUI-0.7.1/datafiles/fonts/dejavusans-10.font
to
/home/username/dev/CELayoutEditor-0.7.1/datafiles/fonts
XIII - Install Ceimageeditor (optional)
Get the latest source from http://www.cegui.org.uk/wiki/index.php/ ... oads_0.7.1. Extract it to "dev" folder so it look like this:
/home/username/dev/CEImagesetEditor-0.7.1
Now open a terminal and do:
cd /home/username/dev/CEImagesetEditor-0.7.1
./configure
make
sudo make install
XIV - Donwnload and Install Code::blocks
sudo apt-get install codeblocks
Start code::blocks and make a new console or ogre project. Now go to Project > Build options and make sure you select the you project name. In Compiler setting > Other options you should have something like this:
`pkg-config --cflags OGRE`
`pkg-config --cflags CEGUI`
`pkg-config --cflags OIS`
`pkg-config --cflags ode`
`pkg-config --cflags CEGUI-OGRE`
-fexceptions
In linker settings > link libraries you should have:
GL
ind debug:
OgreMain_d
OIS_d
in releasse:
OgreMain
OIS
In linker settings > Other linker options you should have:
`pkg-config --libs OGRE`
`pkg-config --libs CEGUI`
`pkg-config --libs OIS`
`pkg-config --libs ode`
`pkg-config --libs CEGUI-OGRE`
In Search directories > Compiler you should have:
/usr/local/share/OGRE/samples/Common/include
/usr/local/include/CEGUI/RendererModules/Ogre
make this to debug and release
Finally the installation is done!
Click in Save All
In your project folder you need create two files:
project_path/plugins.cfg
project_path/resources.cfg
In plugins.cfg:
# Defines plugins to load
# Define plugin folder
PluginFolder=/home/username/dev/ogre_build/lib
# Define D3D rendering implementation plugin
Plugin=RenderSystem_GL.so
Plugin=Plugin_ParticleFX.so
Plugin=Plugin_BSPSceneManager.so
Plugin=Plugin_OctreeSceneManager.so
Plugin=Plugin_CgProgramManager.so
In resources.cfg:
# Resources required by the sample browser and most samples.
[Essential]
Zip=/home/username/dev/ogre/Samples/Media/packs/SdkTrays.zip
FileSystem=/home/username/dev/ogre/Samples/Media/thumbnails
# Common sample resources needed by many of the samples.
# Rarely used resources should be separately loaded by the
# samples which require them.
[Popular]
FileSystem=/home/username/dev/ogre/Samples/Media/fonts
FileSystem=/home/username/dev/ogre/Samples/Media/materials/programs
FileSystem=/home/username/dev/ogre/Samples/Media/materials/scripts
FileSystem=/home/username/dev/ogre/Samples/Media/materials/textures
FileSystem=/home/username/dev/ogre/Samples/Media/materials/textures/nvidia
FileSystem=/home/username/dev/ogre/Samples/Media/models
FileSystem=/home/username/dev/ogre/Samples/Media/particle
FileSystem=/home/username/dev/ogre/Samples/Media/DeferredShadingMedia
FileSystem=/home/username/dev/ogre/Samples/Media/PCZAppMedia
FileSystem=/home/username/dev/ogre/Samples/Media/RTShaderLib
Zip=/home/username/dev/ogre/Samples/Media/packs/cubemap.zip
Zip=/home/username/dev/ogre/Samples/Media/packs/cubemapsJS.zip
Zip=/home/username/dev/ogre/Samples/Media/packs/dragon.zip
Zip=/home/username/dev/ogre/Samples/Media/packs/fresneldemo.zip
Zip=/home/username/dev/ogre/Samples/Media/packs/ogretestmap.zip
Zip=/home/username/dev/ogre/Samples/Media/packs/ogredance.zip
Zip=/home/username/dev/ogre/Samples/Media/packs/Sinbad.zip
Zip=/home/username/dev/ogre/Samples/Media/packs/skybox.zip
[General]
FileSystem=/home/username/dev/ogre/Samples/Media
To test try this simple example from ogre wiki:
Code: Select all
#include "ExampleApplication.h"
class TutorialApplication : public ExampleApplication
{
protected:
public:
TutorialApplication()
{
}
~TutorialApplication()
{
}
protected:
void createScene(void)
{
}
};
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
#define WIN32_LEAN_AND_MEAN
#include "windows.h"
INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
#else
int main(int argc, char **argv)
#endif
{
// Create application object
TutorialApplication app;
try {
app.go();
} catch( Exception& e ) {
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
MessageBoxA( NULL, e.what(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);zx'x
#else
fprintf(stderr, "An exception has occurred: %s\n",
e.what());
#endif
}
return 0;
}
XV - Possible Exceptions
In IX...
If you get an error like :
"/home/username/dev/ogre/Samples/Browser/src/FileSystemLayerImpl_Unix.cpp: In member function ‘void OgreBites::FileSystemLayerImpl::prepareUserHome(const Ogre::String&)’:
/home/username/dev/ogre/Samples/Browser/src/FileSystemLayerImpl_Unix.cpp:127: error: ‘errno’ was not declared in this scope"
Edit /home/username/dev/ogre/Samples/Browser/src/FileSystemLayerImpl_Unix.cpp
One line down of "#include <pwd.h>" (line 33 or so) add this:
#include <errno.h>'
run make again
IN XIV...
if you get an error like:
Installing plugin: GL RenderSystem
OpenGl Rendering Sybsystem created.
Segmantation fault (core dumped)
try to update your video card driver, or get the propietary driver
If you have problem with .so's files like in libOIS_d try to make a copy of release file just like:
Code: Select all
cp -P /usr/lib/libOIS.so /usr/lib/libOIS_d.so
http://poleonlinux.blogspot.com/2010/02 ... 1-ode.html