This page is related is not related to the official Mogre sources!
It's related to a modified bundle of Mogre and some add-ons. This bundle was offered by the Mogre maintainer mstoyke.
Instructions for compiling the official Mogre sources you find in a text file inside the Mogre repository:
For instructions for other Mogre versions, look to the overview page Building MOGRE from source.
Build the modified Mogre 1.7 version
This tutorial describes how to build a modified Mogre 1.7.x from its sources. The repository was created by the Mogre maintainer mstoyke.
In the repository everything is already wrapped and patched. It also includes all dependecies which are needed to compile Ogre.
It has be designed for and tested with Visual Studio 2010 and the .NET 4.0 Framework. Other combinations may work but then the steps below must be adjusted accordingly.
For now this tutorial uses the code from an unofficial code repositories. The benefit of this repository is that it already contains compilable code (that is including all dependencies, auto-generated code, and Visual Studio solution files). For a more "manual" way see ((|#Building_Mogre_from_scratch|Building Mogre from scratch below)).
This tutorial assumes that all files are place in a single folder. For better recognition this folder is called:
Of course you can place this folder whereever you like but then you need to adjust the commands below (which isn't difficult).
For questions about building Mogre 1.7 please refer to this forum thread.
For using this tutorial you need the following pieces of software:
- Visual Studio (preferably in version 2010)
- Mercurial for accessing the code repository. The command line client will suffice but for newbies to Mercurial the GUI client TortoiseHG is recommended.
- The DirectX SDK (February 2010). Other versions may work but in this case some paths in the "RenderSystem_Direct3D9" project needs to be adjusted manually.
A pre-wrapped version of the Mogre sources can be found here: My Mogre repository
To clone the repository and get the right version use:
hg clone -u MST http://bitbucket.org/mstoyke/mogre17vs2010 C:\MyMogreBuild
Then we need to grab the Ogre sources and put them in the right place. A pre-patched version of Ogre can be found here: My Ogre repository
To clone the repository and get the right version use:
hg clone -u MST http://bitbucket.org/mstoyke/ogre171vs2010 C:\MyMogreBuild\Main\OgreSrc\ogre
First build Ogre without any references to Mogre. To do this, open the solution file "C:\MyMogreBuild\Main\OgreSrc\ogre\lib\OGRE.sln" in Visual Studio 2010. In Visual Studio open the file "CLRConfig.h" in "OgreMain->Header Files" and change the define "LINK_TO_MOGRE 1" to "LINK_TO_MOGRE 0".
Depending on where you installed the DirectX SDK, and your operating system's default program files path, you may need to alter some of the preset values for the projects in the ogre solution: "Linker" -> "additional input" -> "additional dependencies" -> change paths with "C:\Program Files (x86)\" to "C:\Program Files\" this change may also need to be applied to the DirectX paths in "C/C++" -> "General" -> "Additional Include Directories"
I recommend using batch build now to rebuild all projects in the solution. Make some coffee, this will take some time.
After some time Ogre will be compiled and we can now build the Mogre wrapper. Open the solution file "C:\MyMogreBuild\Main\Mogre_vs2010.sln" in Visual Studio 2010
By default Mogre will be targeting the .NET Framework v4.0 How to change the target .NET Framework Make sure Visual Studio 2008 is installed if targeting 2.0/3.0/3.5 Project references must also be changed to the respective target .NET Framework version WARNING: choosing v2.0 will result in several linker errors and wasted time (I haven't tested v3 or v3.5 yet)
Use batch build to rebuild all projects in the solution.
When Mogre finished compiling, go back to Ogre solution file "mogre\Main\OgreSrc\ogre\lib\OGRE.sln" and change back the define "LINK_TO_MOGRE 0" to "LINK_TO_MOGRE 1" in "CLRConfig.h".
This time only use batch build to do a normal build for all projects. Rebuild all would just take too long this time because it's not necessary to rebuild everything completely.
Where are the compiled binaries?
Ogre binaries can be found here:
Mogre binaries can be found here:
Important: You need either to copy all Ogre .dlls to your application/project folders or put the Ogre folder in your PATH variable. You should also make sure that no other Ogre folder is included in your PATH (as this might lead to loading the wrong dlls). Note also that the Mogre dll(s) don't need to be placed in the PATH variable.
The classes from the MogreFramework namespace (which are used in the tutorials) are not part of the official Mogre sources. Instead they're developed by the Mogre SDK project. The sources then can be found in the folder:
Building Mogre manually from scratch
In my repositories everything is already wrapped and patched. I will add some instructions how to patch Ogre and rebuild the wrapper files later. I also included all dependecies needed to compile Ogre. Except for Boost, because I didn't use it.
A more common manual for building Mogre should be added here later. Alternatively you could look to Building MOGRE 1.6 from source.
Things to do on this page:
- Include an description of how to build Mogre from scratch.
- Currently the binaries don't seem to contain any documentation (DocumentXML). This needs to be reenabled somehow.
- Change instructions to match steps for bitbucket/mogre repositories instead of obsolete bitbucket/mstoyke repositories