I found that it was a bit of a pain to install on Ubuntu. You can get the packages in Synaptic, but sometimes they are out of date, or there are a few libraries that work together but different versions are incompatible, etc. So I decided the best option was to roll up my sleeves and compile it on my own.
Here's what you have to do: get CEGUI, Cg and OIS. CEGUI is a widget library designed for 3D applications. It's not required for OGRE, but I think it is definitely a good thing to have. OIS is an input system, you use it to interact with the keyboard/mouse/joystick/etc. You can also use SDL for this, but SDL comes with a whole lot of other stuff that you may or may not need. Cg is Nvidia's shader language, from what I've gathered the Ogre guys highly recommend it.
You'll have to compile these guys from source, using the old ./configure + make + make install routine. No big deal. If there is no configure file, then use ./bootstrap first.
One problem with using CEGUI from the Ubuntu repositories is that it is set to use the Xerces XML parsing library. Unfortunately for some reason there are some issues with this, so you have to compile CEGUI yourself and tell it not to use Xerces. It'll probably default to Expat (another XML parsing library) which works well. Use this line instead of the normal ./configure:
./configure --disable-xerces-cand off you go. OIS should install without any problems, as should Ogre. Cg doesn't even need to compile, you just copy the tarball to the root directory and extract it.
Once you've got everything installed, you might have some issues getting things to compile. Type this:
pkg-config --cflags OGRE OIS CEGUIIt should output something like this:
-DOGRE_GUI_gtk -DOGRE_CONFIG_LITTLE_ENDIAN -I/usr/local/includeThese are the include paths to the libraries you just installed, and you'll need to use those flags when you compile your OGRE program. So when you create your makefile, put
CXXFLAGS = `pkg-config --cflags OGRE OIS CEGUI`You have to put the -lCEGUIOgreRenderer if you're using CEGUI, it's the way Ogre and CEGUI communicate with one another.
LFLAGS = `pkg-config --libs OGRE OIS CEGUI` -lCEGUIOgreRenderer
One final hiccup is that Ubuntu doesn't know where to look for the shared object (.so) files once you've gotten your program to compile. They are in /usr/local/lib, but Ubuntu normally puts things in /usr/lib. So you have to edit /etc/ld.so.conf file and add the line:
/usr/local/libat the end. You only need to do this if you have issues with your Ogre app loading the shared objects.
And finally, you need to tell Ogre where to find the plugins. In your plugins.cfg file in the folder where your Ogre app is, make sure that the PluginFolder value is set to /usr/local/lib/OGRE.
Once you have all this going, there are some very well-written tutorials on the Ogre wiki. You should have some good stuff up and running in no time!