%prevogre%
Table of contents
To build ogre you need a couple of dev packages or sources to be added to your system see Building From Source - Shoggoth page for more info.
Install Eclipse
- Download eclipse from www.eclipse.org.
- Unpack it and start it.
- If you didn't select the "Eclipse IDE for C/C++ Developers" version select install it Help -> Software Updates select your eclipse version (Genymede for 3.4) select all the nice stuff in C and C++ Development then select install.
- Install subclipse (subversion support) following the instruction on subclipse.tigris.org.
Ogre Sourcecode
Download Ogre source via SVN
- In File -> New -> Other Select SVN -> Checkout Project from SVN
- Select Create a new repository location and add this url https://svn.ogre3d.org/svnroot/ogre
- Select Trunk or the branch you want to use and select the Next > button. See the Getting OGRE From Subversion page for more info.
- Select Check out as a project configured using the New Project Wizard then Finish
- In the "New Project" wizard select C++ -> C++ Project then Next >
- Add a nice project name like "ogre" and select Makefile project -> Empty Project
- Select the Linux GCC in Toolchains and then Finish
- If you get a resource conflict question select "yes" (use the stuff from the reposetory. (Wait for the checkout to finish... (a few minutes))
Configure Ogre
Open a shell cd the the dir and execute bootstrap (if someone knows how to do this from inside eclipse please update this wiki)
$> cd ~/<your eclipse workspace dir>/<name of the project e.g. ogre> $> ./bootstrap $> ./configure
Build Ogre and Install
Build it from inside eclipse Project -> Build Project (or CRTL + b)
You can install by doing a make install from a shell but I don't think it is needed as the project can find the headerfiles from the "ogre" project directly. But if you wan to install it try this:
$> cd ~/<your eclipse workspace dir>/<name of the project e.g. ogre> $> sudo make install
Create your own project (Basic Tutorial 1)
Here is an setup that will get you started with Basic Tutorial 1
Build and Link
- Select File -> New -> C++ Project
- In the C++ Project window enter a Project name and select project type Executable -> Hello World C++ Project
- Select Toolchain Linux GCC then Finish
- Replace the content of the created .ccp (hello world example) with the content of Initial Code in Basic Tutorial 1. When you build you will notice that it misses a few depandancies.
- Rightclick on the project and select Properties
- Select C/C++ General -> Path and Symbols
- In the Include tab select Add...
- In the "Add directory path" window select Add to all configurations and Add to all languages
- Then select Workspace... and browse to your ogre project and select <ogre project>/OgreMain/Include
- Do the same with <ogre project>/Samples/Common/Include if you are following the tutorials.
- In the Library Paths tab select Add...
- In the "Add..." window select Add to all configurations and Add to all languages
- Then select Workspace... and browse to your ogre project and select <ogre project>/OgreMain/src/.libs
- To add the main lib then in the "Properties for <project name>" window select C/C++ Build -> Settings
- In the "Tool Setting" tab select GCC C++ Linker -> Libraries and add OgreMain and OIS
Now you can build and link.
Run
To run it you need to copy and edit the paths of plugins.cfg and resources.cfg from the ogre examples and place them from where you bin end up.
- Rightclick and select copy on the file <ogre project>/Samples/Common/bin/resources.cfg and past it in your project. Change the paths so it finds the stuff in the <ogre project>.
- Rightclick and select copy on the file <ogre project>/Samples/Common/bin/plugins.cfg and past it in your project. Change the paths so it finds the stuff in the <ogre project>.
Please continue by reading and having fun with all the Ogre Tutorials.
Good Luck!