On Ubuntu, you need to add the Ogre PPA and update your package list before installing the libogre-dev package (containing the Ogre 3D development libraries) and the sample projects:
sudo add-apt-repository ppa:ogre-team/ogre sudo apt-get update sudo apt-get install libogre-dev ogre-samples-sourceThe sample projects are not just useful for examples, but they contain resources used by the skeleton Ogre project in Code::Blocks. Once Ogre is installed, Code::Blocks will offer a new project type called Ogre Project when creating a new project:
Use this to get the minimum set of files and stubs for an Ogre project, along with linker config for the Ogre libraries. However the linker library names for Debug need to be fixed because, in Linux, it's not necessary to link against a special debug library as debug mode is enabled/disabled by compiler flags (-O3 for release and -O2 -g3 for debug).
So to fix the errors "ld cannot find -lOgreMain_d" and "ld cannot find -lOIS_d" in the Build Messages pane, go to Project > Build options... in the Code::Blocks menu, and change the names of the link libraries shown on the Linker Settings tab for the Debug configuration by removing the _d from the end of both libraries' names:
All Ogre projects need a resources.cfg file in the working directory which specifies where to find various resources. Even if your project has no external resources a blank file with this name must be present or you'll see 'resources.cfg' file not found messages when you build. To run the default stub code, a copy of the resources.cfg file from the samples source directory (/usr/share/OGRE) can be used.
Also copy plugins.cfg from the same location, which configures the OpenGL renderer. When you now build and run the project, you should first see the Ogre Renderer Selection dialog:
For me at least, this dialog was a bit tricky to use - I had to click and hold the 'Select One' button in order to see and select the available options.
Once you've selected the renderer, your project should run, and by default you will get a simple sky box with a viewpoint that you can swivel around with the mouse.
Now the basics are up and running, we can start creating 3D apps. A good place to start is the tutorials on the Ogre website.