Access Violation errors with Borland compiled examples

A forum to store posts deemed exceptionally wise and useful
Post Reply
Quibbler
Posts: 25
Joined: Tue Feb 14, 2006 5:34 pm

Access Violation errors with Borland compiled examples

Post by Quibbler »

Hello!

I've finally successfully compiled my own irrlicht.dll with Borland free compiler 5.5.1 with DX9 support.
All examples except example 03 (won't compile) works perfectly with DirectX 9 but when I choose the other APIs I get Access Violation errors right after the window is displayed. Not even the null device works!

However, examples 05.UserInterface and 06.2DGraphics works with all APIs.

So, what is going on here?

My guess is something is wrong in the mesh/material classes but I'm not sure. I'm soon giving up, because I don't really need any meshes or materials, only 2D graphics and GUI with DirectX or OpenGL.

It'd been nice though if all examples worked without lockups.

Anyone?

/Quibbler
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

mmmm, dunno much about Borland as compiler for Irrlicht. Etcaptor is the local authority in Irrlicht Borland compiling. Perhaps you should try and dig some of his stuff out from the forums. He's done some interesting stuff with it (not sure but I think his editor was created with it?) :wink:
Quibbler
Posts: 25
Joined: Tue Feb 14, 2006 5:34 pm

Post by Quibbler »

Well, only problem is that etcaptor is not around here anymore.

I've already downloaded all his sources but those were for 0.12.0
and I want the latest 0.14.0.
That's why I had to look at every file he had and copy line-wise.

I hate version conflicts, so I didn't copy a single file from his sources.

What do you think of my compiler error then?
This is what I get in main.cpp of example 03.CustomSceneNode:
Qualifier 'ISceneNode' is not a class or namespace name in CSampleSceneNode::OnPreRender()
Quibbler
Posts: 25
Joined: Tue Feb 14, 2006 5:34 pm

Post by Quibbler »

ok, now I've found the compiler error in example 03:

in function OnPreRender() line 107:
ISceneNode::OnPreRender();

must be (due to the namespace)
scene::ISceneNode::OnPreRender();

that is, with Borland compiler.

And I also solved the Access Violation errors after debugging with TD32.exe
It was the famous division by zero error after all.

wrong:
#if defined(__BORLANDC__) || defined(__BCPLUSPLUS__)
_control87((_control87(0, 0) | ~011), MCW_EM); //float.h
#endif

must be:
#if defined(__BORLANDC__) || defined(__BCPLUSPLUS__)
_control87(MCW_EM,MCW_EM); //float.h
#endif

So now everything works as expected which means I can finally begin working on my project. :D

/Quibbler
etcaptor
Posts: 871
Joined: Fri Apr 09, 2004 10:32 pm
Location: Valhalla
Contact:

Post by etcaptor »

Yes, I use for Irrlicht 0.14 (MCW_EM,MCW_EM) too.
I thought that I'm alone with Borland compiler and bacause of this not uploaded Irrlicht0.14 for Borland compiler.
So, you can use the same methods with new Borland compiler /Borland Developer Studio 2006/. There only some additional changes is needed. I have download trial version and can say that Irrlicht runs well :D .
ImageImage
Site development -Rock and metal online
--- etcaptor.com ------freenetlife.com
Post Reply