oscene loader with /MDd in VC++ .NET 2003

tulio

06-10-2006 21:23:53

Hi everyone,

I am having troubles to use the oscene loader library with the /MDd option on the code generation.

I am using SDL to get input events so I couldn't figure out how to use it without the Multithred Debug DLL option (in debug mode, and Multithread dll in release mode).

I was already using TinyXML, so no problem with this.

The problem is that when I add the source of the oscene loader in the project the executable just crashes . I don't do anything at all, and do not even include the .h file in any other .cpp file) with the code, just at the cpp in the project and consequently in the .exe file. (the code compiles and links fine).

I get and strange user break point error. Unhandled exception at 0x1062eeb1 in 7seas.exe: User breakpoint.

Strangely in the call stack it just shows the OgreMain_d.dll!1062eeb1()

Any ideia why?

tulio

06-10-2006 22:07:08

I googled around a bit more and found something about heap corruption. The strange is that the code compiles and runs perfectly without the oscene loader files.

Should I recompile Ogre with the MDd option?

Lioric

07-10-2006 02:16:44

The OSM Scene Loader is tested with all dll and static link options, so that is not the problem

Have you modified the Ogre header files, maybe the OSM loader is using a different set of Ogre files

You are not calling any method from the Scene loader, so the problem is more related to a misconfigured setup, mixed headers or link libs

Did you tested with a clean build?

Do a step debug into the code to identify the line that causes it

tulio

07-10-2006 12:30:12

Hi,

I did not modified any ogre file, I am using the pre-compiled SDK. What header files do you think influences in the oscene, i have no experience using it.

I tested a clean build yes. I've reviewed all the code and check all memory leaks and fixed some but found no major problem. I am starting to think that the oscene ended to show a major bug in the code but I just can't figure out what.

A did a step debug and it just crash in the end of a method (in the }). This method load some things in Ogre and CEGUI, probably is some destructor in a class I am using in one of the local variable.

I didn't know oscene is tested with all dll and static link options as you say, so I will try to figure out something wrong with my code.

Lioric

07-10-2006 16:00:12

As noted previously, if you are not calling any method from the OSM scene loader, then you are not using it (the code is there but its not being executed), thus it cant be the cause of your issue

The Scene loader code is executed when you actually call any of its methods

Most probably you are mixing debug with release libraries or different header files

tulio

09-10-2006 15:12:41

HI Lioric,

finally fixed the problem. As we suspected it had nothing to do with the scene loader. It was a heap corruption problem. When deleting a array it crashes. I have no idea why... the code is like this:


in constructor:

this->m_pFloatArray = new float[4];

in destructor

delete[] this->m_pFloatArray;
(it used to work in single threaded but does not work anymore in multthread).

This array has always 4 elements so I declared it as an array and no more uses new, altough I am trying to find a solution because I am not going too far without dinamic arrays...

Strangely the error just pops up when I add the scene loader files - think a should thank the loader for that :P. Another thing I noted is that I wasn't using the USINGTIXML_USE_STL macro in tinyxml, but I thing this wasn't the problem at all...

Lioric

10-10-2006 15:52:08

Are the memory handling calls made in the same thread?
are you using libraries that were compiled with a different compiler version?

Is the memory manager enabled?

Its all of your code compiled with the same runtime library?

Is there any realated issues when you compile the Scene loader demo?