Failed to compile Mogre


22-01-2011 12:10:47

Hey Ganz & mstoyke this one is for you. :-)

I was trying to compile Mogre to get access to the header files for my work on MHydrax and to test the terrain and paging stuff.

I failed at the autowrap step, I get an exception basically about the fact that "std::basic_stringstream" isn't wrappable. it appears in OgrePrerequisites.h line 329 in a typedef mapped to _StringStreamBase.

Any ideas ?


29-01-2011 21:22:02

Hey, does anyone have any advice on this?


30-01-2011 22:36:03

Are you sure that you updated the Mogre sourcecode to the latest version in the "default" branch? I remember there were some compile problems when you update to the "TerrainAndPaging" branch (which is not stable and still work in progress). The correct hash for the changeset in the Mogre repository is: f21db0f80151

And please make sure that you follow the compile instructions in the Mogre repository (file: BUILD) exactly. It is especially important to use the specified version of Ogre. If you update Ogre to a newer version from their repository it could also cause compile issues.

I had to recompile everything from scratch some time ago after one of my harddisks died and it worked without compile errors.


31-01-2011 02:37:49

I tried to compile both the terrainandpaging branch and the default.

I followed the instructions vigorously and I noticed that mogre is "pinned" to a specific revision of ogre.

I can try again... maybe start fresh, but I tried multiple times and i paid very close attention to every small detail and I just kept getting this error.

Does this particular error not ring any bells? Is that class supposed to be wrapped or is not supposed to be there?


01-02-2011 20:44:18

This is especially important:

And I just remembered that you can only change those settings in the advanced configuration mode in the cmake gui. Otherwise those options are hidden and set to the wrong default values.


01-02-2011 20:48:42

Ah that explains it then because this is the only step I skipped as I couldn't see those options... :-)


03-02-2011 22:40:22

Success! Ha! :-)

Indeed the "advanced" checkbox was the problem and that allowed me to get past the annoying exception.

After that I did come across the _ITERATOR_DEBUG_LEVEL linker problem, but I managed to figure it out. I even added a tip to the forum thread.

The instruction are brilliant I would add the advanced checkbox comment and more specific advice on the linker issue but generally they were spot on.

Now that I've managed to do it, the process is far clearer in my head and is actually not that complicated when you think about it. At a top level the mental checklist is:
  1. Checkout/download Mogre code of specific tag.[/*:m]
  2. Checkout/download Ogre code of specific tag.[/*:m]
  3. Patch Ogre code.[/*:m]
  4. Download and compile Ogre dependencies (here come the linker issue - do this in two batches).[/*:m]
  5. Run CMAKE to generate the Ogre build environment. Make sure the right settings are checked/unchecked.[/*:m]
  6. Run cpp2Java to scan the Ogre code and prepare the meta data for the autowrapper.[/*:m]
  7. Run the autowrapper to generate Mogre classes.[/*:m]
  8. Copy a couple of key generated header files to Ogre.[/*:m]
  9. Compile Ogre with LINK_TO_MOGRE turned off so Ogre compiles alone.[/*:m]
  10. Compile Mogre against the compiled Ogre binaries.[/*:m]
  11. Turn LINK_TO_MOGRE back on and re-compile Ogre so that it links back to the Mogre binaries.[/*:m][/list:u]

    Simple! :-)


03-02-2011 22:52:42

Congratz on compiling your own mogre ;) I will add a note in the instructions about the advanced checkbox


04-02-2011 07:51:02

I forgot how insane it is to build "from source". Thanks for the reference!


06-02-2011 15:50:09

Thanks for the hint about the"advanced" checkbox. This was very helpful!

I did everything that is described in here. I got a lots of errors as described there about the problem of "_ITERATOR_DEBUG_LEVEL" and I couldn't solve them properly they just magic as sinbad said.

I'm failing at the step where to compile Mogre itself. VisualStudio is giving me millions of syntax errors in the Mogre files. I didn't change anything in the code. Any idea what could cause this?



07-02-2011 16:04:07

Can you post a snippet of the errors you were getting?

You can also pop into the IRC channel tonight after work. Then I can try and help you interactively with the compilation rather than asynchronously.


07-02-2011 17:21:00

Fine, I will come to IRC tonight. When will you be there?


07-02-2011 23:46:32

For the sake of completion in case someone experiences the same problem and finds this thread.

On IRC we were able to track down the problem to the wrong revision of Ogre being used.

The symptoms of the problem were that the patch and the auto-wrapping worked, but the compilation failed with many different syntax errors all over the place.

The solution is to start over and make sure that the exact revision number of the Ogre code is being used that is given in the build instructions.


13-02-2011 22:02:34

these build instructions


18-02-2011 15:04:07

i tried to build according to Mogre Directives on
While I was on last step,

- For VS2010, open soultion "Mogre\Main\Mogre_vs2010.sln" in Visual Studio.
- Use batch build to rebuild all projects.

I took a lot of errors which is similar above mentioned.

The solution is to start over and make sure that the exact revision number of the Ogre code is being used that is given in the build instructions.

Could anyone write to solution in detail if the problem is solved.

I sent detailed Visual Studio Output here

I think I use that last version and I use below clone codes on Built Instruction.
- Clone Mogre: "hg clone -u Mogre17 Mogre".
- Clone Ogre 1.7: "hg clone -u 58266f25ccd2 Mogre\Main\OgreSrc\ogre".

Maybe versions are not compatible but i dont know well version mechanism of ogre.


I realized important a detail on such as in MogreDataStream.h
Above line includes "İ"character, I know it to i am from Turkey . It is a character of Turkish Alphabet. I wonder, Does Autowrapper's langauge settings cause?



22-02-2011 15:39:19

I'm facing a nasty error that is also described in the BUILD.txt but I can't fix it.

When I try to compile the Ogre binaries the first time (without link to Mogre) VS is throwing lots of ITERATOR_DEBUG_LEVEL errors. I recompiled everything many times, also separated in Debug and Release versions but the error keeps on coming back.

Anyone who had that error and solved it? It only occurs when trying to compile OgreMain in Release mode...


25-02-2011 13:19:05

Well I stumbled upon the same problem and failed to solve it I hope amirabi or mystoke soon solves it so that we can try out the new terrain and paging.