OGRE (Object-Oriented Graphics Rendering Engine)

Creating the project files

This step is the same whether you're using the 'easy' or the 'advanced' way

An OGRE application can be built under Microsoft Visual C++ 6, Microsoft Visual C++.Net or gcc. The way you create project files is different for each:

- Visual C++ 6
- Visual C++.Net
- gcc 3.x

Microsoft Visual C++ 6 (SP3+)

Before you start, make sure you have installed the latest service pack for VC6. Especially before SP3 VC6 had some serious bugs which WILL affect your build. This is not an optional step.

1. Start up VC++ and create a new 'Win32 Application' project.
2. Enter a name for your project and change the location to point to the folder where you copied the SampleApp.cpp. Note that if you go back and change the project name VC alters this so make sure you change it after setting the project name.
3. Select 'An empty project' when prompted for the type of project to create.
4. Switch to the 'File View' tab and expand the tree.
5. Right-click on 'Source Files' and click 'Add Files To Folder...'
6. Select the .cpp file you copied from SampleApp.cpp and click 'Ok'.
7. Save the project.

Next you'll need to change the compiler settings, which is covered in the next section.

Microsoft Visual C++.Net

1. Start up VC++ and create a new C++ project.
2. Select 'Win32 Application' as the type and make sure you tick the 'Empty Project' option.
3. Switch to the 'File View' tab and expand the tree.
4. Right-click on 'Source Files' and click 'Add Files To Folder...'
5. Select the .cpp file you copied from SampleApp.cpp and click 'Ok'.
6. Save the project.

Next you'll need to change the compiler settings, which is covered in the next section.

Gnu Compiler Collection (gcc) v3.x

Before you start, make sure you are using gcc 3.x. Many Linux distributions still come with gcc 2.95.x which does not have as good support for the ISO C++ standard and will probably cause you problems. Please install the latest stable version of gcc 3.x.

Create a file called 'Makefile' in your application folder, with the contents:

      include [ogre_location]/platform-settings

      all:
    	  $(CXX) $(DEFINES) $(CFLAGS) -o [appname] [yourSampleApp].cpp $(INCDIRS) -I$(TOPDIR)/Samples/Common/include -L$(TOPDIR)/OgreMain/lib -lOgreMain

      clean:
    	  rm -f [appname]

Obviously you need to replace [ogre_location], [appname] and [yourSampleApp] with the appropriate values.

Back to Index |  | << Previous section | Next section >>