ISceneManager

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
X-prt
Posts: 7
Joined: Wed Oct 10, 2007 6:20 pm

ISceneManager

Post by X-prt »

Hello everyone,

first: I'm a German so don't expect a perfect English :wink:

I started using Irrlicht a few weeks ago, and now i suddenly have problems i hadn't had before.

I know that 99% of the Softwareproblems sit in front of the monitor and that's why i can't believe that Irrlicht is to blame in any way.

now the description:

It's all about the ISceneManager....

that's my Code:

Code: Select all

#include <iostream>
#include <irrlicht.h>

using namespace irr;

int main()
{
        // start up the engine
	IrrlichtDevice *device = createDevice(video::EDT_OPENGL,
   core::dimension2d<s32>(640,480));

	video::IVideoDriver* driver = device->getVideoDriver();
	scene::ISceneManager* smgr = device->getSceneManager();

	smgr->addCubeSceneNode(60);
	smgr->addCameraSceneNode();
        
	while(device->run())
	{
		driver->beginScene(true, true, video::SColor(0.0,0.0,0.0,0.0));
                smgr->drawAll();
		driver->endScene();
	}
        
	device->drop();
	return 0;
}
the Line that makes the Application break down is "smgr->drawAll();"
and it's not a Compiling error... it's a runtime error.
everything workes but all smgr - methods.
the standart Windows error (which want's me to send the details to microsoft)
i don't know why... it ever runed before, without any problems.
So I think i just forgot one thing...

i'm using Dev-C++
and i include the include-directory of Irrlicht
"E:\Programme\irrlicht-1.3.1\include"

i also added the Irrlicht-library to the Linker-Parameters
"../../../irrlicht-1.3.1/lib/Win32-gcc/libIrrlicht.a"

but there shouldn't be a problem at all.

so does anyone of you know what the problem could/should be?
sader
Posts: 28
Joined: Sat Sep 29, 2007 1:38 pm

Post by sader »

try add this line

Code: Select all

using namespace irr;

#pragma comment(lib, "Irrlicht.lib")
maybe it will fix

BTW why not use all namespaces?
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
:)
shogun
Posts: 162
Joined: Wed Sep 05, 2007 11:02 am
Location: inside

Post by shogun »

sader wrote:BTW why not use all namespaces?
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
:)
Because namespaces are there for a reason, too much "using namespace" make namespaces useless.
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

libIrrlicht.a is correct.

The code looks fine. What is the text of the error? Without that, we're just guessing. Here we go...

One common runtime problem is when the lib and the dll don't match. Have you rebuilt Irrlicht yourself? Have you moved the lib or the dll around, or changed your PATH environment? Is there any chance that you're linking against \lib\Win32-gcc\libIrrlicht.a but picking up \bin\Win32-VisualStudio\Irrlicht.dll at runtime?

That's me out of ideas, until we see the error.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
X-prt
Posts: 7
Joined: Wed Oct 10, 2007 6:20 pm

Post by X-prt »

D'oh... i solved it....

rogerborg, you were right... my output-directory was not where the Irrlicht.dll was... now it is and surprise, it works.
thanks a lot.

@sader:

Code: Select all

#pragma comment(lib, "Irrlicht.lib") 
doesn't that tell the linker to link the Irrlicht.lib?
then that cannot be the mistake because i need the gcc-Irrlicht.a
Post Reply