Ogre 2.1 runs in Release but crashes in Debug

Discussion area about developing with Ogre2 branches (2.1, 2.2 and beyond)
Post Reply
aymar
Greenskin
Posts: 145
Joined: Fri Jun 12, 2015 6:53 pm
Location: Florianopolis, Brazil
x 16

Ogre 2.1 runs in Release but crashes in Debug

Post by aymar »

In release it works perfectly.

I've defined _DEBUG and DEBUG, I'm using the correct plugins (plugins_d.cfg), and for some reason, when I run in debug, I get "string iterator not dereferencable" in OgreRoot constructor.

Can anyone help me?

aymar
Greenskin
Posts: 145
Joined: Fri Jun 12, 2015 6:53 pm
Location: Florianopolis, Brazil
x 16

Re: Ogre 2.1 runs in Release but crashes in Debug

Post by aymar »

Code: Select all

#ifndef _DEBUG
		this->ogreRoot = OGRE_NEW OgreRoot(configFilesPath + "/plugins.cfg", configFilesPath + "/setup.cfg", configFilesPath + "/setup.log");
#else
		this->ogreRoot = OGRE_NEW OgreRoot(configFilesPath + "/plugins_d.cfg", configFilesPath + "/setup.cfg", configFilesPath + "/setup.log");
#endif
And I've compiled Ogre with Multi-Byte character set, and my projects are using Unicode (idk if this could cause the crash ?!)

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 4208
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 802
Contact:

Re: Ogre 2.1 runs in Release but crashes in Debug

Post by dark_sylinc »

Ogre needs to be compiled with the same macro settings as the app.

Normally the biggest offender right now is NDEBUG, which is a bad practice we had and have yet to address.

Is this Windows or Linux?

aymar
Greenskin
Posts: 145
Joined: Fri Jun 12, 2015 6:53 pm
Location: Florianopolis, Brazil
x 16

Re: Ogre 2.1 runs in Release but crashes in Debug

Post by aymar »

Oh, I'm sorry, I forgot to add more data.

It's on Windows 7 64 bits. Compiled in 32 bits. I didn't set NDEBUG in Debug mode, but I correctly set NDEBUG in release, which works.

In debug I set _DEBUG and DEBUG macros, which are (I believe) the ones used by Ogre.

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 4208
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 802
Contact:

Re: Ogre 2.1 runs in Release but crashes in Debug

Post by dark_sylinc »

I forgot to ask for the callstack! Also where it crashes: What line, near assembly if no src. Reason of crash (e.g. null pointer?)

Post Reply