Assertion failed error


17-08-2010 19:30:03

Hi everybody,

first off, I'm new to Mogre, so please bear with me if you saw my problem too many times already
(although I couldn't find anything about it on Google or this forum's search).
I tried to assemble the program for the Basic Tutorial 0 in the Wiki, but encountered this error after hitting F5:
"Microsoft Visual C++ Runtime Library"
Assertion failed!
Program: ...
File: ..\..\ogre\OgreMain\src\OgreRoot.cpp
Line: 112
Expression: ms_Singleton

The window also says to press Retry to debug the app (JIT is enabled, I pressed Retry and nothing happened).
The Mogre init window is already on the screen and froze while "Creating the root object".

I also tried the program for the Basic Tutorial 6 since I read that my error may be related to a wrong version
of MogreFramework.dll, but the error appears even without it.

System-specs are Visual Studio 2008 + SP1 on Windows 7 x64 (target platform of the project is x86 though,
as I got a BadImageFormatException that was resolved by this setting).
Even though I installed vcredist_x86.exe aswell, the dependency checker didn't detect it during install
I hope that's not a problem as re-install of Mogre and vcredist didn't fix it - I have no idea what to try next

Best regards,

Okay, it looks like my computer is really trying to make me go nuts. I swear to god, this
NOTE: If you get a line 80 or a line 100 exception after build, try to copy your build exe into the appropiate Debug or Release folder in your MogreSDK library (default: C:\MogreSDK\bin\(Debug or Release) and run it.
did not work when I tried it earlier, but of course it does now that I wrote this novel... Sorry for wasting space here :oops:


19-08-2010 14:56:45

This happens when you didn't create an instance of "Mogre.Root". Have you used the basic tutorial code as it was or did you change it?


19-08-2010 20:11:22

Welcome to Mogre. :D

The Basic Tutorial 0 is outdated.
Now our MogreSDK installer checks for depencies and help to download/install them if needed.
Did you install the current MogreSDK? If not, please do it.

Ignore Tutorial 0 and start with Basic Tutorial 1 instead :wink:

But right - we should write a tutorial how to setup an own application.
About the resource.cfg file, the directory structure and what to copy from the MogreSDK to the own project.


01-09-2010 14:14:17

Hello there,

After banging my head with mOgre 1.7.1 I installed the pre-compiled binaries for mOgre 1.6.5 (stable as the Google Code page says). Trying to run the samples browser, no sample could be found, so I loaded the solution to compile them myself. There was no compilation error, but I got the same Assertion Failed when trying to run in Debug mode.

After that, I ran the BuildSamplesx86.cmd (although it seems to just call MSBuild to compile the Solution Projects to Release version). After that, I decided to run the Release version of the samples and I didn't get any error.

I'm using Windows 7 Professional 32-bit with Visual Studio 2008 SP1. I'll give another try to mOgre 1.7.1, this time testing it in Visual Studio 2010 too.


06-09-2010 00:11:35

Maybe the reason is in relation to the debug version.
Which Mogre.dll file did you link? Debug or Release version?
I only use the Release version.
2 years ago I read that the debug version of Mogre.dll needs an additionally depency, but I'm not shure if this is right for today.
Also there can be problems by mixing dll files of Debug and Release versions. (e.g. Mogre.dll as Debug and OgreMain.dll as Release or Plugin_xxx.dll as ...)

In the past I had a similar problem, that happened on every compilation run.
Visual Studio replaced the linked dll file by an other dll file version.
I don't know why, but I found a way to solve the problem:

In Visual Studio change a property of the linked Mogre.dll file.
VS -> project map explorer -> links -> Mogre -> right click -> properties -> local copy = FALSE

Maybe it helps in your case.

An other thing you can try is to find out, which dll file is missing (if you have a FileNotFoundException).
Start the tool Process Monitor, start the Mogre application and stop the Monitor recording after the exception comes.
Then look in the Process Monitor for operations with the result "File not found" or "Path not found".
Use the filter to remove results of all other events. (right click to an event and click "Exclude ...")

I hope this could help.
And sorry for the late answer - I was on holiday.