Building Under Eclipse And GCC         Eclipse 3.1 + CDT 3.0.0 RC2 + Gcc 3.4 (MinGW + MYSys) + Ogre 1.0.3

%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)