%prevogre%
Eclipse 3.1 + CDT 3.0.0 RC2 + Gcc 3.4 (MinGW + MYSys) + Ogre 1.0.3

Originally written by Steven.

Goals :

Compiling ogre on Windows without cygwin, pkgconfig, autotools, bootstrap, etc etc.
   Using a newer gcc (MinGW) than the one from cygwin.

Using only MinGW + MYSys.

Creating a complete verbous step-by-step instructions to compile ogre and a simple application.


Please, use this forum thread to discuss problems, suggestions, etc.

For 0gre 1.2.5 check this thread: http://www.ogre3d.org/phpBB2/viewtopic.php?t=28129

TODO : Make a linux version of these instructions. Anyone interested ?

TODO : Make a .zip containing all the Eclipse project file. Sort of SDK.

TODO : Compile all the dependencies with Eclipse and not be dependent on the CodeBlocks lib. If someone could help me here... there are some libraries I couldn't compile without pkgconfig :-(


If you have a functional Eclipse 3.1, CDT 3.0 and MinGW 3.4.4, you can go directly to part 3.

1- Install MinGW and MSys

I am on a Windows platform so I used the MinGW version 3.4.4 + MYSys.

AFAIK, there is no 4.0 version of gcc for windows (MinGW). The MinGW developer forum suggest that because of regressions they will wait after 4.2.

1.1 - Verify you environment

Open a "Command window"
 Type "gcc -v" and "strip -V"

If you get something like: "gcc version 3.4.4 (mingw special)" and "strip 2.15.94",
then you have a functional MinGW + MSYS and you can skip this part.

1.2 - Install MinGW

There can be conflit if you have another gcc (for examples from cygwin).
Because I didn't need cygwin anymore I uninstalled it!

If you need cygwin, I am not sure what you must do. Because if you change the environment variable PATH, cygwin will not work anymore.
So what I suggest is to change the PATH variable within Eclipse (see point 1.4 and 4.3) and cygwin should still work normaly.

You need at least the following from the MinGW site :

gcc-core
  gcc-g++
  mingw-runtime
  w32api
  binutils
  gdb


CAREFUL : The debugger gdb has a known bug, it must not be installed in a path containing space !

Install the packages in a directory '''without''' spaces.

For example "C:\tools\mingw" not "C:\Program Files\mingw".

1.3 - Install MSYS

For example, C:\tools\mysy .

CAREFUL : It must not be in the same directory as mingw (both bin directories must not be merged).

1.4 - Set the PATH variable

If you have cygwin, you will need to replace the PATH in Eclipse (see 4.3).

If you don't have cygwin, you can simply set the environment variable PATH to point to both bin directories.
You can test you installation by doing the 1.1 part.

2 - Install Eclipse

See also this thread if you have problems installing Eclipse : Guide : Integrate Ogre with Eclipse.

Download and install : eclipse-SDK-3.1-win32.zip.
 Download org.eclipse.cdt-3.0.0-RC2-win32.x86.zip (or later).
 Extract it in the Eclipse directory.
 Create shortcuts to eclipse.exe to lauch Eclipse more easily.

3 - Download and install Ogre

3.1 - Install Ogre

Unzip ogre-win32-v1-0-3p1.zip in a new directory.

I created a "C:\library\Ogre" so I got "C:\library\Ogre\ogrenew" .

3.1 - Install the 3rd-party libraries

I will use the libraries compiled by the CodeBlocks team : codeblocks-dependencies-1.0.1.zip at http://sourceforge.net/project/showfiles.php?group_id=2997&package_id=149087

Unzip the content of codeblocks-dependencies-1.0.1.zip in "ogrenew".
 Copy all .dll from "ogrenew/Dependencies/bin" in :
  - "ogrenew/Samples/Common/bin/Release" and 
  - "ogrenew/Samples/Common/bin/Debug"

You should have now a directory called "ogrenew/Dependencies".

Commentary :
I will not use the libraries provided on the Ogre site : "3rd-party Dependencies For MingW" at http://www.ogre3d.org/index.php?option=com_remository&Itemid=74&func=selectcat&cat=4 .

If you want to use these libraries, you will have several headaches :

The slightly different library paths, for example : "mingw/include" instead of "Dependencies/include/Release".
A missing libzziplib.a. You will probably need to take it from CodeBlocks !
Two missing dlls : cg.dll and ceguibase.dll.
The naming of the libraries are not conventional. This is confusing especially for the libraries zlib and zziplib who should not be confused with the projects zzip and zzlib!
The codeblocks libraries contain additional useful libraries : CEGUI, xerces and ode !
The libraries are relatively old.

4 - Configure Eclipse for Ogre

4.1 - Launch Eclipse.

It will ask to open a Workspace (a workspace is created by opening Eclipse in the desired directory).

Open a workspace in "ogrenew/Scripts".

CAUTION : NOT in "ogrenew" because you would would't be able to create projects in subdirectories relative to ogrenew !!!
I lost a whole day because of this ! You could put the workspace in a completly different directory but then you couldn't use relative paths in the settings :-/

4.2 - Modify several default preferences for the workspace

- Window -> Preferences -> General -> Perspectives -> Available perspectives : 
   set C/C++ as default.

 - Window -> Preferences -> General -> Workspace -> Linked Resources : 
   add a defined path variables : "OgreEclipse" which will contain 
   the full path to the ogrenew directory. For example "C:\library\Ogre\ogrenew".

 - Window -> Preferences -> General -> Workspace -> Build automatically : 
   set to false.

You can let the automatic build but I found it annoying.
Until the next version of CDT the indexer is extremely slow, I suggest that you disable if you only compile Ogre !
This issue should be corrected in the version 3.1 version of CDT.

- Window -> Preferences -> C/C++ -> Indexer : set to "No Indexer" !

There is a bug, sometimes when you launch Eclipse again you will need to set No indexer for each project... :-(

4.3 - Setting environment variables in Eclipse

You PATH variable must contain the path to the mingw and mysys binaries.
If you haven't set PATH globally, you can set it in Eclipse :

- Window -> Preferences -> C/C++ -> Managed Build -> Environment :
   define a new "User Variables" by selecting the PATH variable 
   and ''Prepend'' the path to the mingw and mysys binaries :
   ''C:\tools\mingw\bin;C:\tools\Msysy\1.0\bin;''

Note : Don't put the path in "" !
I used only "Managed build project" but you can also do this for "Make Project"
Set it in Window -> Preferences -> C/C++ -> Make -> New Make Project -> Environment.

CAREFUL : For those with Cygwin, it will NOT work because during the first run of Eclipse,
the path to the cygwin bin will be kept somewhere and automatically prepended it to the PATH environment !
This means that for EACH project you will need to prepend the correct MinGW bin path to the PATH variable.
If you find another solution, let me know !

To be safe, quit and launch Eclipse again.

5 - Compile Ogre with Eclipse

I will now explain in detail how to compile Ogre to run the Demo_BezierPatch sample. The rest of Ogre will be explained in the following chapters.

We need to build at least :

OgreMain.dll
  OgrePlatform.dll
  Plugin_ParticleFX.dll
  RenderSystem_Direct3D9.dll (or RenderSystem_GL.dll)


The settings for the other plugins and executable will be displayed in the following chapter.

NOTE : I am using the "Managed Build", this will automatically create a /Release and /Debug directores where the .o will be stored.
I don't know how to set Eclipse to put them in the Ogre "obj" and "lib" directories. I could make a postbuild copy instruction but it's not very elegant.
Help needed.

5.1 - Demo_BezierPatch project : compile Demo_BezierPatch.exe

This executable needs OgreMain.dll to compile but OgreMain is big and the compilation is about 20 min on my pc.
So, to verify if we set up correctly Eclipse we will first try with a small project in Release mode.
It's nearly the same for the Debug but its to see if we can compile something.

5.1.1 - Create a new "Managed Make C++ Project" with :

- File -> New -> Managed Make C++ Project :
    - Project Name : Demo_BezierPatch
    - Project contents -> Directory : OgreEclipse/Samples/BezierPatch
    - Click Finish.

IMPORTANT : Do not use the default directory! "OgreEclipse" is the variable you set before

If Eclipse ask to open the C/C++ perspective, I recommand that Eclipse remembers your decision.
You can change perspective by clicking on the small icon in the top right of the ide.
Know you should see the files contained in the directory that appear in your Navigator.


5.1.2 - Open the properties of your project.

(Right click on the Demo_BezierPatch folder icon).

- C/C++ Build -> Active configuration -> Configuration : select Release.

 ''[OPTIONAL]'' - C/C++ Build -> Build Settings -> Build Command : 
   replace "make -k" by "mingw32-make -k". Click Apply to save it.

NOTE : Modifying the default make is perhaps not necessary for you (it was for me). See the discussion on the forum.

It's a "Managed Make" so you can't change the default command... or I didn't found how to change it :-/

- C/C++ Build -> Tool Settings -> Preprocessor -> Defined Symbols : 
   _WIN32, NDEBUG and _WINDOWS

NOTE : ZeroSkill suggest that you need to use _WIN32 instead of WIN32. I (Steven) had no problem with WIN32 (and nobody reported any problem with it) hence use the settings that suits you. I (bohan) confirm that _WIN32 is the right thing to use with all compilers, as WIN32 (without underscore) is not defined by default in all compilers, including mingw. This concerns the source code tho: If the source code uses WIN32, the source code needs to be fixed.

- C/C++ Build -> Tool Settings -> Directories -> Include paths : 
   ../include, ../../Common/include and ../../../OgreMain/include

 - C/C++ Build -> Tool Settings -> Libraries -> Libraries : OgreMain

 - C/C++ Build -> Tool Settings -> Libraries -> Library search path :
   ../../../OgreMain/Release

 - C/C++ Build -> Tool Settings -> Miscellaneous -> Linker flags :
   -Wl,--enable-runtime-pseudo-reloc

 - C/C++ Build -> Build Steps -> Post-build step -> Command : 
     ''cp Demo_BezierPatch.exe "../../Common/Bin/Release" ; ''
     ''strip "../../Common/Bin/Release/Demo_BezierPatch.exe"''
 - C/C++ Build -> Build Steps -> Post-build step -> Description : 
     "copy & strip"

NOTE : The command line is a single line.
NOTE : Do not put a space after the comma for the linker flags it creates a link error difficult to find.

It's "-Wl,-- " not "-Wl, --".

5.1.3 - Build the project

(You can stop the compilation by clicking on the icon in the bottom right of the ide).

- Build the project, it should exit with the following error : 
   ''..\..\mingw32\bin\ld.exe: cannot find -lOgreMain''

Success! You correctly set up your Eclipse + MinGW + Ogre environment.
If you don't have this there is a problem somewhere !

Now. To compile this sample we need OgreMain.dll.


5.2 - OgreMain project : compiling OgreMain

This will be fairly similar to the last project.

- File -> New -> Managed Make C++ Project :
    - Project Name : OgreMain
    - Project contents -> Directory : OgreEclipse/OgreMain
    - Click next 
    - Project Type : '''Shared Library'''
    - Click Finish

Project properties :

- C/C++ Build -> Active configuration -> Configuration : select Release.

 - C/C++ Build -> Build Settings -> Build Command : 
     replace "make -k" by "mingw32-make -k". Click Apply to save it. 

 - C/C++ Build -> Tool Settings -> Preprocessor -> Defined Symbols : 
     _WIN32, NDEBUG, _USRDLL, _MT, OGRE_NONCLIENT_BUILD

 - C/C++ Build -> Tool Settings -> Directories -> Include paths : 
     ../include, ../../Dependencies/include,
     ../../Dependencies/include/freetype2

 - C/C++ Build -> Tool Settings -> Libraries -> Libraries : 
     kernel32, user32, zziplib, zlib, libfreetype, IL, ILU and ILUT

The order is important : zziplib must be before zlib.

See point 3.2 if you have a z/zzip/zziplib library compile error.
If you use the ogre 3rd-party libraries you should have : z.dll instead of zlib.

- C/C++ Build -> Tool Settings -> Libraries -> Library search path :
     ../../Dependencies/lib/Release

 - C/C++ Build -> Tool Settings -> Miscellaneous -> Linker flags : nothing!

 - C/C++ Build -> Build Steps -> Post-build step -> Command :
     ''cp OgreMain.dll "../../Samples/Common/Bin/Release" ; ''
     ''strip "../../Samples/Common/Bin/Release/OgreMain.dll"; ''
     ''cp OgreMain.dll "../../Tools/Common/bin/Release"; ''
     ''strip "../../Tools/Common/bin/Release/OgreMain.dll"''

 - C/C++ Build -> Build Steps -> Post-build step -> Description :
     "copy & strip"

 - (Re)Build the project and wait 20 minutes...

There will be more than 100 warnings, ignore them (or submit a patch :-) )
Take a break and a double wiskey, if you have "Build complete for project OgreMain"

5.2.2 - Rebuild Demo_BezierPatch again.

It should build.

5.3 - Build PlatformManager_Win32

From now on, I will try to be more concise. Look at the preceding paragraph if you are not sure what the settings mean.

5.3.1 - Managed Make

- Project Name  : PlatformManager_Win32
 - Directory     : OgreEclipse/PlatformManagers/Win32
 - Project Type  : Shared Library

 - Configuration : select Release.
 - Build Command : mingw32-make -k
 - Preprocessor  : _WIN32, NDEBUG, _WINDOWS, _USRDLL, 
                   PLATFORMMANAGER_WIN32_EXPORTS
 - Include paths : ../include, ../../../OgreMain/include, ../misc,
                   ../../../Dependencies/include
 - Libraries     : OgreMain, dxguid, dinput8 and dinput
 - Library path  : ../../../OgreMain/Release, ../../../Dependencies/lib/Release
 - Linker flags  : -Wl,--enable-runtime-pseudo-reloc
 - Post-build    : cp PlatformManager_Win32.dll 
                   "../../../Samples/Common/Bin/Release/OgrePlatform.dll"; 
                   strip "../../../Samples/Common/Bin/Release/OgrePlatform.dll"
 - (Re)Build the project...

5.3.2 - Compiling win32 resources (OgreWin32Resources.rc)

There could be a catch ! OgreWin32Resources.rc must be compiled with windres.

If, later, you execute ogrenew/Samples/Common/bin/Release/Demo_BezierPatch.exe ,
and you get the following message error:

Error #: 1812
   Function: Win32ConfigDialog::display

Then you need to compile the win32 resource .rc :

- In Eclipse right-click on OgreWin32Resources.rc
 - Open the C/C++ Build view :
    - Exclude from build must not be set.
    - Configuration : Release
    - Custom Build Step Applicability : 
        ''Apply Custom Build Step Overriding Other Tools''
    - Output file name(s) : OgreWin32Resources.o
    - Command : ''windres -o "./misc/OgreWin32Resources.o" -I"../misc"''
                ''-I"../include" "../misc/OgreWin32Resources.rc"''
    - Description : Win32 Resources Compilation
 - Project Properties :
    - C/C++ Build -> Linker -> Miscellaneous -> Other objects :
      ./misc/OgreWin32Resources.o
 - (Re)build the project.

5.3.3 - Plugins.cfg

Plugin.cfg tells to Ogre which plugin it should use and load.

- Open ogrenew/Samples/Common/bin/Release/Plugins.cfg
 - Modified it (for this project) as follow : 
 
      # Defines plugins to load
   
      # Define plugin folder
      PluginFolder=.
   
      # Define plugins
      #Plugin=RenderSystem_Direct3D7
      Plugin=RenderSystem_Direct3D9
      #Plugin=RenderSystem_GL
      #Plugin=Plugin_ParticleFX
      #Plugin=Plugin_BSPSceneManager
      #Plugin=Plugin_OctreeSceneManager
      #Plugin=Plugin_CgProgramManager

 - Run Demo_BezierPatch.exe

At this point, it should complain that the library RenderSystem_Direct3D9 is missing.

5.4 - Build RenderSystem_Direct3d9

- Project Name : RenderSystem_Direct3D9
 - Directory : OgreEclipse/RenderSystems/Direct3D9
 - Project Type : Shared Library

 - Configuration : Release.
 - Build Command : mingw32-make -k
 - Preprocessor  : _WIN32, NDEBUG, _WINDOWS, _USRDLL, OGRE_NONCLIENT_BUILD,
                   OGRED3ENGINEDLL_EXPORTS
 - Include paths : ../include, ../../../OgreMain/include, ../../../Dependencies/include
 - Libraries     : OgreMain, gdi32, d3d9, d3dx9d, dxerr9, dxguid
 - Library path  : ../../../OgreMain/Release, ../../../Dependencies/lib
 - Linker flags  : -Wl,--enable-runtime-pseudo-reloc
 - Post-build    : cp RenderSystem_Direct3D9.dll 
                   "../../../Samples/Common/Bin/Release"; strip 
                   "../../../Samples/Common/Bin/Release/RenderSystem_Direct3D9.dll"
 - (Re)Build the project... ignore the warnings.

 - Run Demo_BezierPatch.exe.

The option window should open. If not, see if you did the step in 5.3.2 : windows resources .rc.

- Select the only renderer system you have : direct3d9 
 - Set full screen to No (easier if you have an error and a black screen) and click ok.

An exception will occur : Error #: 4 : Cannot find requested emitter type.
We need the plugin ParticleFX.

5.5 - Build Plugin_ParticleFX

- Project Name  : Plugin_ParticleFX
 - Directory     : OgreEclipse/Plugins/ParticleFX
 - Project Type  : Shared Library
 - Configuration : Release.
 - Build Command : mingw32-make -k
 - Preprocessor  : WIN32, NDEBUG, _WINDOWS, _USRDLL, PLUGIN_ParticleFX_EXPORTS
 - Include paths : ../include, ../../../OgreMain/include, ../../../Dependencies/include
 - Libraries     : OgreMain
 - Library path  : ../../../OgreMain/Release, ../../../Dependencies/lib/Release
 - Linker flags  : -Wl,--enable-runtime-pseudo-reloc
 - Post-build    : cp Plugin_ParticleFX.dll "../../../Samples/Common/Bin/Release";
                   strip "../../../Samples/Common/Bin/Release/Plugin_ParticleFX.dll"
 - (Re)Build the project... ignore the warnings.

 - Uncomment in Plugins.cfg : Plugin=Plugin_ParticleFX

 - Run Demo_BezierPatch.exe. The option window should open. 
 - Select the only rendery system you have : direct3d9 
 - Set full screen to No (for now) and click ok.

Congratulations... you have compiled Ogre.


6 - Build the rest...

6.1 - Build RenderSystem_GL

6.1.1 - gl.h and glxext.g

Be advised : There is something strange with the OpenGl includes. The compilation and executables worked for me on two different machines. But perhaps I am making something wrong because I am mixing old and new versions !

My versions of these files were :

gl.h    : ''mingw : gl.h,v 1.3 2003/09/12 GL_VERSION_1_3, ogre : GL_VERSION_1_2''
  glext.h : GL_GLEXT_VERSION 11, ogre uses a version 7



To be able to compile this rendering system, I had to :

- Copy gl.h from MinGW (for example mingw\include\GL) to ogrenew\RenderSystems\GL\include\GL.
   There is already a version of gl.h either replace/rename it, i.e. gl.h_TOOLD.
 - Delete/rename glext.h in mingw ! i.e glext.h_TOOLD .

NOTE : You must change the extension so that Eclipse will not recognise it as a .h file.

6.1.2 - Project settings

- Project Name  : RenderSystem_GL
 - Directory     : OgreEclipse/RenderSystems/GL
 - Project Type  : Shared Library
 - Configuration : Release.
 - Build Command : mingw32-make -k
 - Preprocessor  : WIN32, NDEBUG, _WINDOWS, _USRDLL, RenderSystem_GL_EXPORTS,
                   OGRE_GL_USE_MULTITEXTURING
 - Include paths : ../include, ../../../OgreMain/include, ../../../Dependencies/include,
                   ../src/win32, ../src/nvparse, ../src/nvparse/winheaders, 
                   ../src/atifs/include and ../src/glsl/include
 - Libraries     : OgreMain, gdi32, OPENGL32, GLU32
 - Library path  : ../../../OgreMain/Release, ../../../Dependencies/lib/Release
 - Linker flags  : -Wl,--enable-runtime-pseudo-reloc
 - Post-build    : cp RenderSystem_GL.dll "../../../Samples/Common/bin/Release";
                   strip "../../../Samples/Common/bin/Release/RenderSystem_GL.dll"

6.1.3 - Exclude from build some files : GLX, gtx, SDL

If you need a glx, gtx, SDL or this specific nvparse build, you are on your own :-)

Please, change the instructions here only if you are SURE that you will not cause havoc.
Far better to append a specific chapter : SDL, gtx, ...
Of course, if you find a better way to compile everything ... tell me!

On windows, I needed to exclude from the build the files from several directoreis.
Alternatively, you could simply delete these directories but you would need to do it each time you make an upgrade with cvs.

- Right-click on each file in these directories :
   C/C++ Build -> Actice Resource Configuration : set Exclude from build to true.
   This must be set for both configuration : debug and release.

The files you need to exclude are all .cpp and .h in :


src/GLX/
src/gtk/
src/SDL/
src/nvparse/ps1.0__test_main.cpp


6.1.4 - Compiling glprocs.c

RenderSystems/src/glprocs.c is a C source file not a C++, the managed build does not include C files automatically.
(It's an Eclipse bug... or I didn't set up Eclipse correctly.)

To compile this file you need to :

- In Eclipse right-click on glprocs.c
 - Open the C/C++ Build view :
    - Exclude from build must not be set.
    - Configuration : Release
    - Custom Build Step Applicability : Apply Custom Build Step Overriding Other Tools
    - Output file name(s) : glprocs.o
    - Command (in one line) : 
       ''mingw32-gcc -DWIN32 -DNDEBUG -D_WINDOWS -D_USRDLL
       -DRenderSystem_GL_EXPORTS -DOGRE_GL_USE_MULTITEXTURING 
       -I"../include" -I"../src/win32" -I"../../../OgreMain/include"
       -I"../../../Dependencies/include" -I"../src/nvparse" -I"../src/nvparse/winheaders"
       -I"../src/atifs/include" -I"../src/glsl/include" -O3 -Wall -c -fmessage-length=0
       -osrc/glprocs.o ../src/glprocs.c''
    - Description : Gcc compilation of glprocs

 - (Re)build the project.
 - Don't forget to change plugin.cfg if you want to use your opengl plugin :-D

6.1.5 - (Optional) "Pragma warning" error

In the file src/nvparse/nvparse_errors.h, there is an erroneous use of #ifdef
because of this there are a lot of warnings on gcc.

You could correct this file with the following tips :

See http://www.mobydisk.com/softdev/techinfo/cpptips.html for reference.

      Misuse of #ifdef _WIN32
      
      // If we are on Windows, disable some stupid MSVC warnings
      #ifdef _WIN32
      #pragma warning (disable:4786)
      #endif
      
      The above is a mistake. It checks to see if you are compiling on a WIN32
      platform, and if so, issues a command to the MSVC compiler. The author has
      forgotten that there are other compilers for WIN32. Compiling the above code
      with gcc/mingw on Windows may result in an error about an incorrect compiler
      directive. The proper way to write this code is:
      
      // If we are on MSVC, disable some stupid MSVC warnings
      #ifdef _MSC_VER
      #pragma warning (disable:4786)
      #endif
      
      The above code is what the author truly intended. To check the compiler, 
      not the OS.

6.2 - Build Plugin_BSPSceneManager

- Project Name  : Plugin_BSPSceneManager
 - Directory     : OgreEclipse/Plugins/BSPSceneManager
 - Project Type  : Shared Library
 - Configuration : Release.
 - Build Command : mingw32-make -k
 - Preprocessor  : WIN32, NDEBUG, _WINDOWS
 - Include paths : ../include, ../../../OgreMain/include
 - Libraries     : OgreMain
 - Library path  : ../../../OgreMain/Release, ../../../Dependencies/lib/Release
 - Linker flags  : -Wl,--enable-runtime-pseudo-reloc
 - Post-build    : cp Plugin_BSPSceneManager.dll "../../../Samples/Common/bin/Release";
                   strip "../../../Samples/Common/bin/Release/Plugin_BSPSceneManager.dll"
 - Modify Plugins.cfg

6.3 - Build Plugin_CgProgramManager

- Project Name  : Plugin_CgProgramManager
 - Directory     : OgreEclipse/Plugins/CgProgramManager
 - Project Type  : Shared Library
 - Configuration : Release.
 - Build Command : mingw32-make -k
 - Preprocessor  : WIN32, NDEBUG, _WINDOWS, _USRDLL, PLUGIN_BSPSCENEMANAGER_EXPORTS
 - Include paths : ../include, ../../../OgreMain/include, ../../../Dependencies/include
 - Libraries     : OgreMain, cg
 - Library path  : ../../../OgreMain/Release, ../../../Dependencies/lib/Release
 - Linker flags  : -Wl,--enable-runtime-pseudo-reloc
 - Post-build    : cp Plugin_CgProgramManager.dll "../../../Samples/Common/bin/Release";
                   strip "../../../Samples/Common/bin/Release/Plugin_CgProgramManager.dll"
 - Modify Plugins.cfg

CAREFULL : The Cg.dll is not an Ogre one. If you don't use the CodeBlocks dependencies, you need to download it from another site. For example, Nvidia.

6.4 - Build Plugin_OctreeSceneManager

- Project Name  : Plugin_OctreeSceneManager
 - Directory     : OgreEclipse/Plugins/OctreeSceneManager
 - Project Type  : Shared Library
 - Configuration : Release.
 - Build Command : mingw32-make -k
 - Preprocessor  : WIN32, NDEBUG, _WINDOWS, _USRDLL, PLUGIN_TERRAIN_EXPORTS
 - Include paths : ../include, ../../../OgreMain/include
 - Libraries     : OgreMain
 - Library path  : ../../../OgreMain/Release, ../../../Dependencies/lib/Release
 - Linker flags  : -Wl,--enable-runtime-pseudo-reloc
 - Post-build    : cp Plugin_OctreeSceneManager.dll "../../../Samples/Common/bin/Release";
                   strip "../../../Samples/Common/bin/Release/Plugin_OctreeSceneManager.dll"
 - Modify Plugins.cfg

6.5 - Build ReferenceAppLayer

- Project Name  : ReferenceAppLayer
 - Directory     : OgreEclipse/ReferenceApplication/ReferenceAppLayer
 - Project Type  : Shared Library
 - Configuration : Release.
 - Build Command : mingw32-make -k
 - Preprocessor  : WIN32, NDEBUG, _WINDOWS, _USRDLL, REFERENCEAPPLAYER_EXPORTS
 - Include paths : ../include, ../../../OgreMain/include, ../../../Dependencies/include
 - Libraries     : OgreMain, ode
 - Library path  : ../../../OgreMain/Release, ../../../Dependencies/lib/Release
 - Linker flags  : -Wl,--enable-runtime-pseudo-reloc
 - Post-build    : cp ReferenceAppLayer.dll "../../../Samples/Common/bin/Release";
                   strip "../../../Samples/Common/bin/Release/ReferenceAppLayer.dll"

If you can't build and link it's probably because you don't have ODE.
This was the reason I switched to CodeBlocks dependencies... it was easier than to try to build ODE :-)

6.6 - Build OgreGUIRenderer

- Project Name  : OgreGUIRenderer
 - Directory     : OgreEclipse/Samples/Common/CEGUIRenderer
 - Project Type  : Shared Library
 - Configuration : Release.
 - Build Command : mingw32-make -k
 - Preprocessor  : WIN32, NDEBUG, _WINDOWS, _USRDLL, OGRE_GUIRENDERER_EXPORTS
 - Include paths : ../include, ../../../../OgreMain/include, 
                   ../../../../Dependencies/include, ../../../../Dependencies/include/CEGUI
 - Libraries     : OgreMain, CEGUIBase, xerces-c_2_6
 - Library path  : ../../../../OgreMain/Release, ../../../../Dependencies/lib/Release
 - Linker flags  : -Wl,--enable-runtime-pseudo-reloc
 - Post-build    : cp OgreGUIRenderer.dll "../../bin/Release" ; 
                   strip "../../bin/Release/OgreGUIRenderer.dll"



7 - Building the Demos

All the following projects are very similar :

Demo_CameraTrack, Demo_CelShading, Demo_CubeMapping, Demo_Dot3Bump, Demo_DynTex,
  Demo_EnvMapping, Demo_Fresnel, Demo_Grass, Demo_Lighting, Demo_ParticleFX, 
  Demo_RenderToTexture, Demo_Shadows, Demo_SkeletalAnimation, Demo_SkyBox, Demo_SkyDome,
  Demo_SkyPlane, Demo_Smoke, Demo_Terrain, Demo_TextureFX, Demo_VolumeTex, Demo_Water

 - Project Name  : Demo_XXXXX
 - Directory     : OgreEclipse/Samples/XXXXX
 - Configuration : Release
 - Build Command : mingw32-make -k
 - Preprocessor  : WIN32, NDEBUG, _WINDOWS
 - Include paths : ../include, ../../Common/include, ../../../OgreMain/include
 - Libraries     : OgreMain
 - Library path  : ../../../OgreMain/Release
 - Linker flags  : -Wl,--enable-runtime-pseudo-reloc
 - Post-build    : cp Demo_XXXXX.exe "../../../Samples/Common/bin/Release" ;
                   strip "../../../Samples/Common/bin/Release/Demo_XXXXX.exe"

Note the XXXXX in the project directory and the post-build command.

The exceptions are :

7.1 - Build Demo_Gui

- Include paths : ../include, ../../Common/include, ../../../OgreMain/include,
                   ../../../Dependencies/include, ../../../Dependencies/include/CEGUI, 
                   ../../Common/CEGUIRenderer/include
 - Libraries     : OgreMain, CEGUIBase, OgreGUIRenderer
 - Library path  : ../../../OgreMain/Release, ../../../Dependencies/lib/Release,
                   ../../Common/CEGUIRenderer/Release

7.2 - Build Demo_Transparency

Careful : The demo is in the directory "Samples/Transpacency" and not "Samples/Transparency". Note the c instead of r !

- Project Name  : Demo_Transparency
 - Directory     : OgreEclipse/Samples/Transpacency

7.3 - Build Demo_BSP

Before you run the Demo_BSP.exe, the CVS quake3setting.cfg must be adapted to your environment :

- Download the compiled samples from the ogre site, use its .cfg and its .pk3
   (which contains the quake level)
 - Edit the quake3settings.cfg to indicate where the location of the pack is :
   "Pak0Location: ../../../media/packs/chiropteraDM.pk3"
 - Put the .cfg with the others .cfg files.
 - Put the .pk3 in the directory : Samples\Media\packs .

Now, the BSP demo should run.

7.4 - Build Demo_BSPCollision

- Directory     : OgreEclipse/ReferenceApplication/BspCollision
 - Include paths : ../include, ../../Common/include, ../../../OgreMain/include,
                   ../../../Dependencies/include, ../../ReferenceAppLayer/include
 - Libraries     : OgreMain, ReferenceAppLayer
 - Library path  : ../../../OgreMain/Release, ../../../Dependencies/lib/Release,
                   ../../ReferenceAppLayer/Release

--Steven 08:31, 16 Aug 2005 (CDT)

<HR>
Creative Commons Copyright -- Some rights reserved.


THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.

BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.

1. Definitions

  • "Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
  • "Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of doubt, where the Work is a musical composition or sound recording, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered a Derivative Work for the purpose of this License.
  • "Licensor" means the individual or entity that offers the Work under the terms of this License.
  • "Original Author" means the individual or entity who created the Work.
  • "Work" means the copyrightable work of authorship offered under the terms of this License.
  • "You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
  • "License Elements" means the following high-level license attributes as selected by Licensor and indicated in the title of this License: Attribution, ShareAlike.

2. Fair Use Rights

Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.

3. License Grant

Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:

  • to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
  • to create and reproduce Derivative Works;
  • to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
  • to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works.
  • For the avoidance of doubt, where the work is a musical composition:
    • Performance Royalties Under Blanket Licenses. Licensor waives the exclusive right to collect, whether individually or via a performance rights society (e.g. ASCAP, BMI, SESAC), royalties for the public performance or public digital performance (e.g. webcast) of the Work.
    • Mechanical Rights and Statutory Royalties. Licensor waives the exclusive right to collect, whether individually or via a music rights society or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions).
    • Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor waives the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions).


The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved.

4. Restrictions

The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:

  • You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients' exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any credit as required by clause 4(c), as requested. If You create a Derivative Work, upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work any credit as required by clause 4(c), as requested.
  • You may distribute, publicly display, publicly perform, or publicly digitally perform a Derivative Work only under the terms of this License, a later version of this License with the same License Elements as this License, or a Creative Commons iCommons license that contains the same License Elements as this License (e.g. Attribution-ShareAlike 2.5 Japan). You must include a copy of, or the Uniform Resource Identifier for, this License or other license specified in the previous sentence with every copy or phonorecord of each Derivative Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Derivative Works that alter or restrict the terms of this License or the recipients' exercise of the rights granted hereunder, and You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Derivative Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Derivative Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Derivative Work itself to be made subject to the terms of this License.
  • If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Derivative Works or Collective Works, You must keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or (ii) if the Original Author and/or Licensor designate another party or parties (e.g. a sponsor institute, publishing entity, journal) for attribution in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; the title of the Work if supplied; to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.

5. Representations, Warranties and Disclaimer

UNLESS OTHERWISE AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE MATERIALS, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.

6. Limitation on Liability.

EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

7. Termination

  • This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works or Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
  • Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.

8. Miscellaneous

  • Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
  • Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
  • If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
  • No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
  • This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.