Installing Xdebug for use with Eclipse or Netbeans on Linux
A Simple ISAPI Filter for Authentication on IIS
Symfony 2 Crash Course
Enforce Coding Standards with PHP_CodeSniffer and Eclipse IDE on Ubuntu Linux
Changing Mailman Python Scripts for Virtual Host Support
Visualising Website Performance with Flame Graphs

Getting Set up with Ogre 3D on Ubuntu

Monday, 25 April 11, 7:36 pm
The Open Source Code::Blocks IDE is the recommended choice on Linux systems, and it's available in Ubuntu's Software Centre. Install this first if you don't already have it.

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-source
The 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.
2 

Guest

6:52 am, Wednesday, 4 May 11

I bow down humbly in the presence of such greatness.

Guest

12:42 am, Thursday, 5 May 11

That's way more clever than I was expecting. Thanks!

Guest

2:33 am, Monday, 18 July 11

I too do bow humbly :D
they were missing the "ogre-samples-source"
plus the dialog also was tricky at first :P
thx :)

me

3:03 pm, Monday, 19 September 11

Thank you very much! It worked!
2 

Please enter your comment in the box below. Comments will be moderated before going live. Thanks for your feedback!

Cancel Post

/xkcd/ Number Shortage