Crash Running Example Application

Problems building or running the engine, queries about how to use features etc.
mdwh
Gnoblar
Posts: 4
Joined: Mon Feb 06, 2006 12:33 am

Crash Running Example Application

Post by mdwh »

I'm trying to follow the instructions at http://www.ogre3d.org/wiki/index.php/Se ... pplication . I'm using Visual C++ 6 (just installed the latest service pack). In debug mode however, it crashes ("The instruction at "0x00e9ced5" referenced memory at "0x0000000c". The memory could not be "read".". The log is:

23:10:00: Creating resource group General
23:10:00: Registering ResourceManager for type Material
23:10:00: Registering ResourceManager for type Mesh
23:10:00: Registering ResourceManager for type Skeleton
23:10:00: Loading library OgrePlatform_d.dll
23:10:00: OverlayElementFactory for type Panel registered.
23:10:00: OverlayElementFactory for type BorderPanel registered.
23:10:00: OverlayElementFactory for type TextArea registered.
23:10:00: Registering ResourceManager for type Font
23:10:00: ArchiveFactory for archive type FileSystem registered.
23:10:00: ArchiveFactory for archive type Zip registered.
23:10:00: DevIL version: Developer's Image Library (DevIL) 1.6.7 May 27 2004
23:10:00: DevIL image formats: bmp dib cut dcx dds gif ico cur jpg jpe jpeg lif mdl mng jng pcx pic pix png pbm pgm pnm ppm psd pdd psp pxr sgi bw rgb rgba tga vda icb vst tif tiff wal xpm raw
23:10:00: Registering ResourceManager for type HighLevelGpuProgram
23:10:00: Loading library plugins\RenderSystem_Direct3D9

I tried removing the reference to that plugin, but it then crashes on the OpenGL one. I've taken my Plugins.cfg file and the plugins directory from the "OgreDemos" examples. Running in the debugger, the call stack is:

OGREMAIN! 00e9ced5()
OGREMAIN_D! 10360454()
OGREMAIN_D! 1035b938()
ExampleApplication::setup() line 75 + 384 bytes
ExampleApplication::go() line 55 + 13 bytes
WinMain(HINSTANCE__ * 0x00400000, HINSTANCE__ * 0x00000000, char * 0x00132cb2, HINSTANCE__ * 0x00000000) line 64
WinMainCRTStartup() line 330 + 54 bytes
KERNEL32! 7c598989()

It seems to crash when calling "mRoot = new Root();".

I get a little further in Release mode - I get the config window. But it then gets a "Runtime error!" when opening up the graphics window (error window is titled "Microsoft Visual C++ Runtime Library"), with the message "abnormal program termination".

I get the same problems running both from the IDE, and running the program directly.

I have a Radeon 9800 gfx card and am running Windows 2000 (sp 4). The example demos work fine on my machine.

I noted that I needed to add the include and lib paths for STLport in order to get it to compile, but this step isn't mentioned in the wiki - I don't know if I've done something wrong with STLport here?

Any ideas? Thanks in advance for any help.

Are there any source code examples that include the Visual C++ project files? That would be a handy way of checking, but I haven't been able to find any.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179

Post by jacmoe »

I think you might be able to grab a few vc6 projects from ogreaddons.. :wink:
mdwh
Gnoblar
Posts: 4
Joined: Mon Feb 06, 2006 12:33 am

Re: Crash Running Example Application

Post by mdwh »

Ah, I appear to have solved the problem!

There appear to be two issues:

Firstly, I nicked the DLLs from the OgreDemos, and for some reason, this causes problems - even though the demos run fine, my compiled program in Release mode has problems. Many of the DLLs are different sizes, so I'm not sure which one is the culprit. Now that I've taken a copy from the Ogre SDK, it's fixed the problem.

Does anyone know what was going wrong here? The Wiki tutorial suggests "The easiest way to get everything configured is to copy an existing OGRE sample and the media directory into your own working directory." which I presumed meant from an example, so it's especially confusing for a beginner that this causes problems.

Another issue is that I didn't realise a separate set of DLLs were needed for debug mode (in particular, the plug ins, it seems). Now that I've got the debug and release DLLs entirely seperate, and both copied from the SDK, it seems to work. I guess my confusion was that some of the DLLs are named with "_d" to indicate a debug version, so it's not immediately obvious that some DLLs have two separate versions which can't be mixed (assuming this was the problem?)

Thanks for your reply jacmoe - in the end, I suddenly realised that there were project files in the SDK anyway. This at least confirmed that wasn't the problem wasn't with the project file, and I was able to narrow down the cause.