These steps are for ubuntu users. the paths may differ for other linux distributions but i think the steps are the same.

Be sure to have installed Ogre3D and code::blocks on ubuntu before you proceed. The ogre3d wiki is a good start if you search for installation how-to’s.

Step 1:

Open Code::Blocks and create an ogre3D project with the wizard.

Step2:

After creation right click the project in your workspace and choose the “Project Build Options“.

Go to the  “Linker Settings” tab and change the libOIS and libOgre paths according to my screenshot:

codeblocksogresettings

Step 3:

Goto the “Search directories” tab and in the “compiler” subtab add the path to the ExampleApplication.h file.

in my case it’s

/home/myuser/Development/lib/ogre/Samples/Common/include

You should be able to compile your project now. :-) )

Step 4:

Now we need to make sure, that the the run command also works on our small project.

Therefore we need to change the execution path of our project’s binary.

This can be done by right-clicking  the project in the workspace again but this time select the “Properties…” option.

Switch to the “Build targets” tab and alter the parameter for “Execution output dir:” to your ogre3d installations sample folder.

In my case this is

/home/myuser/Development/lib/ogre/Samples/Common/bin

Now you can run the project.

That’s it. Happy coding.