OGRE (Object-Oriented Graphics Rendering Engine)

Frequently Asked Questions (FAQ)

Q: What platforms does OGRE build under?

Platform | Compiler | Extra Notes
Windows 95/98/Me/2000/XP | Microsoft Visual C++ 6 SP3+ Microsoft Visual C++.Net | DirectX 8.1b SDK Due to STL problems with MS compilers you MUST install STLport 4.5.3
Linux | gcc 3.x gcc 2.9x with STLport STLport 4.5.3 | gcc 3.2 highly recommended. See Linux README
Mac OSX | gcc 3.x | See the Mac README

Q: When do I need STLport and why?

You need STLport if you're running Microsoft Visual C++ (version 6 or .NET), because the STL implementation in VC++ 6 is very old (the one in VC++ .NET is very nice and actually works with OGRE, but we're not supporting it yet), pretty slow and has a number of known bugs. The issue which makes it totally unsuitable for OGRE is that STL classes cannot be passed across a DLL boundary using the MS STL; it will instantly cause a crash. OGRE is very DLL oriented so this makes the MS STL unusable. STLport is more stable, and is faster than MS STL in release mode.

You also need STLport if you're using gcc 2.9x because the STL included with this version is not ANSI compliant enough for OGRE. You don't need it if you have gcc v3.x because the STL in that version has been updated.

Q: How do I install STLport?

www.stlport.org and unzip it somewhere

- Open a command prompt, and change to the folder STLport-4.5.3\src
- If you're using Visual C++ 6:
  1. make sure you've run VCVARS32.BAT from the MSVC6 folder, in the same command prompt window
  2. type 'nmake -f vc6.mak clean all'
- If you're using Visual C++.Net:
  1. make sure you've run VSVARS32.BAT from the MSVC .NET folder, in the same command prompt window
  2. type 'nmake -f vc7.mak clean all'
- If you're using gcc 2.9x:
  1. type './configure'
  2. type 'make'
  3. type 'make install'
- Open Microsoft Visual C++ and select Tools | Options... from the menu bar to bring up the options dialog
- Go to the include folders list: in VC6 this is on the 'Directories' tab, in VC++.Net it is under Projects|VC++ Directories in the tree on the left
- Make sure the stlport include directory is at the TOP of your include folders list. Crucially, it MUST be above all Microsoft include folders.
- Make sure your stlport lib directory is in your library folder list.
- Close VC++ to save the settings

Q: Why do I have problems compiling the DirectX-based source files in Microsoft Visual C++ 6?

This is usually related to the fact that you haven't installed the DirectX SDK on your computer or you have installed it but the headers and libraries folders from the SDK aren't in the compiler's search path. Microsoft Visual C++ 6 comes with DirectX SDK version 5 while OGRE needs at least DirectX SDK version 8.1. You can get the latest DirectX SDK distribution from Microsoft's DirectX page.

Q: What is the 'Dependencies' folder for?

Ogre depends on a number of external libraries such as jpeglib, libpng, zlib, and SDL. Rather than expect people to have these already or download them separately, and to minimise problems with incompatible versions of these libraries, you can download them from the Ogre download page (get the '3rd party libraries' download). You only need this if you are using Microsoft Visual C++ because Linux distributions usually come with these libraries built in (just in case yours doesn't, use RPMfind).

Q: Why do I get a message like 'unable to open zlib.h' or some other header file?

If you're using VC++, make sure you've downloaded the 3rd-party libraries distribution from the Ogre download page. This archive should be extracted into the parent folder of the 'ogrenew' folder.

Q: How do I extract the .tar.bz2 archives?

If you're using Linux, or you have downloaded the Cygwin tools under Windows, just type the followiing commands in the same folder as the file:

bunzip2 <file>.tar.bz2

tar -xvf <file>.tar

If you're using Windows without the Cygwin tools, just use a decent archive GUI like PowerArchiver or WinRAR which support bzip2 and tar (among other formats).

Q: Why have you changed from zip format to .tar.bz2?

Because the files created by bzip2 are up to half the size of the equivalent zip file. This makes your downloads quicker.

Q: When I try to debug a sample or my own application, I get an error saying plugins.cfg is not found, why?

The relative location of OGRE library files and configuration files are very important for successfully starting an OGRE application, in debug mode or otherwise. The existing samples provided copy their executables into 'Samples\Common\bin\Debug' or 'Samples\Common\bin\Release', where all the other files are placed correctly. It is recommended that you set up your own examples to place their executables in the same location to avoid problems, and debug them from there too.

If you do want to move the files, bear in mind the following dependencies:

- The OgreMain and OgrePlatform libraries must be in the same folder as the executable, or on the path
- The plugins.cfg file must be in the same folder as the executable
- The plugin libraries listed in plugins.cfg must be located in the folder specified in the 'PluginFolder' setting in plugins.cfg

Q: I have problems loading some resource files (textures, meshes, material definitions etc)

Check the following:

1. Make sure the case of the filenames is correct. Some operating systems are case-sensitive in their file operations, and all of OGRE's internal lookups for reusing resources is case-sensitive so assume that case IS important.
2. Make sure the location of the resource is on the resource path. You can add resource paths by calling Root::addResourceLocation and supplying either a folder or a ZIP compressed archive to search in
3. If you're trying to use a material or particle system scripted from a .material or .particle file, ensure that the resource locations are added before you call Root::initialise

Q: What is the minimum set of resource files I need to run my own OGRE application?

You need at least:

- Ogre.overlay
- Ogre.material
- sample.fontdef.

These scripts contain the core overlay details used for the frame rate stats panel.

Q: After I did a CVS update, no matter what demo/app I try to run, I get thrown in the debugger because of what appears to be memory over-runs/allocation problems.

This is because there have been major changes in the core OGRE library, changes that affect all the other linked plug-ins/apps. The solution is simple (though a bit slow): a full rebuild of all the OGRE sources.

Q: Why do I get errors about 'LPDIRECTINPUT7' : missing storage-class or type specifiers?

This is caused by either not having the DirectX SDK, or having the include folder for it lower down on your include list than an oder version of the Windows platform SDK or the Visual C++ include folders. Make sure your DirectX SDK includes are above VC / Platform SDK but still below STLport.

ÿ