Help compiling from source


29-06-2009 14:25:32


I cannot build from source the latest version of Mogre in the SVN (272). I'm using Visual Studio 2009. This is the process that I've followed:

- Download and compile Ogre 1.6.2
- Download the Mogre sources
- Copy the directory with the compiled Ogre into the base Mogre directory (at the same level as AutoWrap)
- Run the cpp2java/build.bat script
- Build and run the AutoWrap tool
- Edit the CLRConfig.h file and set LINK_TO_MOGRE to 0
- Build Mogre_vc9.sln

When I try to build the Mogre solution, I get many errors because of missing files, both headers (MogreRenderWindow.h, MogreLight.h, MogreViewport.h...) and source files (MogreZip.cpp, MogreWireBoundingBox.cpp, MogreTexture.cpp...).

I also get an error in the MogrePlaneBoundedVolume.h file: "'_CLRHandle' : is not a member of 'Ogre::PlaneBoundedVolume'".

Could you tell me what I'm doing wrong?



17-07-2009 16:01:21

... i need help too. Followed same directions, got the same result (!) ... at least now my failure has company (better than following the wiki for the older (1.4) version ... that didn't appear at all compatible w/ the latest version).

So what is the actual current process for rebuilding the latest (1.6) Mogre? (... and the magic sauce is?)

(purpose: to get a full debug path down into Ogre to help us track arcane bugs, like "exception: 'Present' failed" ...)



17-07-2009 20:28:42

One clue seems to be wrto Wrapper.cs in AutoWrap: its TypeIsWrappable() routine is returning false cuz it can't figure out what kind of wrapper to use (which prevents Wrapper from converting Ogre* to Mogre*).

Specifically, when tracing for OgreRenderWindow.h, TypeIsWrappable() thinks that RenderWindow is a DefClass, but notices that it neither has an CLRAtrribute nor is it a Singleton, so it gives up (returns false).

Unfortunately, I don't know what kind of wrapper should have been used w/ RenderWindow nor why TypeIsWrappable() got confused. This seems to be the problem w/ the other missing 'wrapped' .h's also.
(I'm presuming that it should still be wrapped, since its wrapped properly in earlier 1.4 Mogre)

Any suggestions?



24-07-2009 16:44:11


Not that it helps us do it 'from scratch' nor solves the 'Wrapping' issues, (and the forums seem very quiet this week), but i have had success building Mogre following:


<edited pertinent excerpts follow>
Postby Bekas ยป Mon May 11, 2009 11:12 pm
You can get all necessary, ready-to-compile source files from here

This should do it:
-Open "Mogre-src\Ogre\Ogre_vc9.sln"
-In the OgreMain project, open "CLRConfig.h" and set "LINK_TO_MOGRE" to 0
-In OgreMain -> Configuration properties -> Linker -> Input, remove 'Mogre_d.lib' entry from Debug and 'Mogre.lib' from Release
Debug: kernel32.lib user32.lib zziplibd.lib zlibd.lib freetype235_D.lib freeimaged.lib
Release: kernel32.lib user32.lib zziplib.lib zlib.lib freetype235.lib freeimage.lib

-Batch build Debug/Release projects
Takes an hour or so ...
Ignore (for now) 'tool returned an error' errors, instead check Mogre-src\Ogre\lib for dll's

-Open "Mogre-src\Mogre-vc9.sln"
-Batch build

-In OgreMain project again, set "LINK_TO_MOGRE" to 1
-In OgreMain -> Configuration properties -> Linker -> Input, restore 'Mogre_d.lib' and 'Mogre.lib' entries.
Debug: kernel32.lib user32.lib zziplibd.lib zlibd.lib freetype235_D.lib freeimaged.lib Mogre_d.lib
Release: kernel32.lib user32.lib zziplib.lib zlib.lib freetype235.lib freeimage.lib Mogre.lib

-Batch build Ogre again.
Again, ignore "post build" errors (tools/common/bin/ debug/release directories are missing but not needed)

(this is not the "official" way to compile Mogre, this is temporary until the "proper" guidelines are up)