Setting Up An Application - Prelude         In order to run your application, there are various files that need to be locatable by your system

In order to run your application, there are various files that need to be locatable by your system. The list below details these files. [_d] denotes an optional reference to a debug library (ie OgreMain_d.dll instead of OgreMain.dll). These files should be in your working directory, or accessible by an appropriate path.

On Mac OS X, your project must be run from an application bundle (aka ".app"), otherwise Ogre will not initialise properly. XCode does this for you automatically, but if you don't use XCode you will have to build the bundle manually.

The easiest way to get everything configured is to copy an existing OGRE sample and the media directory into your own working directory. If using Windows, copy all the necessary runtime DLLs to this directory. Edit plugins.cfg and resources.cfg so that the file locations they contain match this new directory.

OGRE Libraries & Files:

  • OGRE libraries (OgreMain[_d].dll, for linux).
  • plugins.cfg - Text file specifying the rendering libraries available to Ogre (ie DX9, OpenGL).
  • All the plugin libraries listed in plugins.cfg (you can remove items from plugins.cfg if you don't wish to use them).
  • resources.cfg - If using the ExampleApplication, a text file specifing paths to materials, textures, models, etc.
  • - Ensure resources.cfg has the proper path to this file if you plan to use the OGRE debug panel or profiler.
  • Other Resources used in your program (*.zip; *.png; *.particle; *.mesh; ...).

3rd Party Libraries:

The following packages also need to be installed if building from source (not SDK). The libraries (.lib; .a) and header files (.h) will be required for linking and the runtime libraries (win32 .dll; linux .so) necessary for running. If on the Windows platform, it is highly recommended to use the precompiled dependencies available on Source releases. Grab the correct package for your compiler.

These are required:

  • Zlib: zlib1.dll; (debian: zlib1g, zlib1g-dev)

These are optional:

  • CEGUI: OgreGUIRenderer[_d].dll, CEGUIBase[_d].dll, CEGUITaharezLook[_d].dll, CEGUIWindowsLook[_d].dll, xerces-c_2_5_0.dll
  • CEGUI:,, (debian: libcegui-mk2-0, libcegui-mk2-dev, libxerces26, libxerces26-dev)
  • Cg: cg.dll; (debian: nvidia-cg-toolkit)
  • OpenEXR: openexr.dll??; (debian: libopenexr-dev libopenexr2 )
  • ReferenceApp: ReferenceAppLayer.dll

Extras for Microsoft Visual C++ 6 (SP3+):

  • stlport_vc6[_stldebug]46.dll
  • msvcp60[D].dll
  • msvcrt[D].dll

Extras for Microsoft Visual C++.Net 2002:

  • stlport_vc7[_stldebug]46.dll
  • msvcp70[d].dll
  • msvcr70[d].dll

Extras for Microsoft Visual C++.Net 2003:

  • msvcp71[d].dll
  • msvcr71[d].dll

Extras for Mingw + STLPort:

  • libstlport[stlg].5.0.dll
  • mingwm10.dll

Environment Settings

You may want to register an environment variable pointing at the root of the OGRE installation so you can express all your paths relative to that. It can be easier if you ever move things around or onto a different machine. For information on checking and updating environment variables, see the documentation for Windows, Linux and Mac OSX.

  • If you downloaded and installed the precompiled OGRE SDK, you should already have an environment variable called 'OGRE_HOME' registered already, pointing at the folder where you installed. If it isn't there you probably installed under a different user, so define OGRE_HOME manually
  • If you downloaded the source distribution, you should register a new environment variable OGRE_SRC pointing at the 'ogrenew' folder from the OGRE source

Create A Project File

This section is not for extensive compiler/IDE settings. It is only for very short steps to start a new project. This should be very easy to do in any IDE. The source code that will go into the project is below. Create a working directory to store your source code. A standard directory structure separates headers, source files and project files as follows: