Skip navigation

When trying to compile/run my new Ogre app in release mode, I came up with this error:

Assertion failed!

Program: …
File: f:\codingextra\ogre\shoggoth_vc9\ogr…\ogreroot.cpp
Line: 103

Expression: ms_Singleton

For information on how your porgram can cause an assertion failure, see the Visual C++ documentation on asserts

(Press Retry to debug the application – JIT must be enabled)

Abort/Retry/Ignore

OK here’s the image

It turns out that this problem comes up because you tried to build in Release mode while still linking to the DEBUG MODE (ending in _d.dll) libraries.

The libraries that ogre will link to are in plugins.cfg:

# Defines plugins to load

# Define plugin folder
PluginFolder=.

# Define plugins
Plugin=RenderSystem_Direct3D9_d
Plugin=RenderSystem_GL_d
Plugin=Plugin_ParticleFX_d
Plugin=Plugin_BSPSceneManager_d
Plugin=Plugin_CgProgramManager_d
Plugin=Plugin_PCZSceneManager_d.dll
Plugin=Plugin_OctreeZone_d.dll
Plugin=Plugin_OctreeSceneManager_d

So I just changed this file to:

# Defines plugins to load

# Define plugin folder
PluginFolder=.

# Define plugins
Plugin=RenderSystem_Direct3D9
Plugin=RenderSystem_GL
Plugin=Plugin_ParticleFX
Plugin=Plugin_BSPSceneManager
Plugin=Plugin_CgProgramManager
Plugin=Plugin_PCZSceneManager.dll
Plugin=Plugin_OctreeZone.dll
Plugin=Plugin_OctreeSceneManager

Just basically taking away all the _d at the end of the file names.

I also made sure to LINK TO the correct libraries – I prefer inline linking instead of fiddling with the Visual Studio Project options dialog boxes, so I have this code:

#ifdef _DEBUG
#pragma comment( lib, "CEGUIBase_d.lib" )
#pragma comment( lib, "OgreGUIRenderer_d.lib" )
#pragma comment( lib, "OIS_d.lib" )
#pragma comment( lib, "OgreMain_d.lib" )
#else
#pragma comment( lib, "CEGUIBase.lib" )
#pragma comment( lib, "OgreGUIRenderer.lib" )
#pragma comment( lib, "OIS.lib" )
#pragma comment( lib, "OgreMain.lib" )
#endif
Advertisements

2 Comments

  1. Also happened to me on Mac with Ogre 1.6.1 when I forgot to drop in the plugins.cfg at all.

    • antred
    • Posted March 7, 2011 at 10:25 pm
    • Permalink

    Thank you, this problem has been giving me headaches for a while. :)


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: