Page 1 of 1

Why Won't this work..

Posted: Mon Apr 05, 2004 2:48 pm
by fritz
Why wont this work?!

Code: Select all

	CGame game;
	game.run();
Okay the game runs totally fine when I have all my code in 'main', but if I put all the code in CGame::run then call it from main as above, the console just sits there and nothing happens, why?!? Please help!

My code is in this topic: http://irrlicht.sourceforge.net/phpBB2/ ... php?t=2009

Posted: Mon Apr 05, 2004 9:03 pm
by Electron
try running your debugger and see where the program does go

Posted: Mon Apr 05, 2004 10:37 pm
by fritz
It compiles and runs all the code up until
"device =
createDevice(video::EDT_OPENGL, core::dimension2d<s32>(800, 600), 16, false, false, this);
"

It didnt do this once I had it back in C, but ever since I transfered it to C++ and added support for classes and what not, every time I call
CGame game;
game.run();

it hangs once it gets to CreateDevice... some one said something about multithreading i dunno, my source is at that link incase you want to look for the problem

Posted: Mon Apr 05, 2004 10:47 pm
by Acki
What is ", this)" ????
well, I know what it is, but you have to set it to 0 or create an event receiver and enter its pointer (I think <g>)....


CU

Posted: Tue Apr 06, 2004 1:56 am
by Guest
This IS the pointer to the name of the event reciever... (My class, CGame, is based on IEventReciever)

From Game.h

Code: Select all


class CGame : public IEventReceiver
{
public:
	virtual bool OnEvent(SEvent event);
	void run();
	CGame();
	virtual ~CGame();

I did put it to 0 though, and I at least got some messages from the console... Saying the DLL is 0.6 and the app was compiled with 0.4.2 on how to fix that...

Posted: Tue Apr 06, 2004 1:57 am
by fritz
How would I fix that**

Posted: Tue Apr 06, 2004 1:59 am
by fritz
Bleh, It keeps comming out wrong!!!!!! Where do I put the Irrlicht.lib file! There, said it right!

Posted: Tue Apr 06, 2004 3:09 am
by Domarius
Put the Irrlicht.lib file in C:\Windows\System32

Make sure the versin of Irrlicht you're linking to in your IDE (Dev-C++ or MSCV) is the same version as the DLL you're using.
(0.6)

To find out, watch what version it says it is on the console as you run your program.

Posted: Tue Apr 06, 2004 4:48 am
by codechief
Domarius wrote:Put the Irrlicht.lib file in C:\Windows\System32
I think it might be a better idea, in my (humble) opinon, to set your PATH in
the environment variables to point to the Irrlicht lib directory. This setting
has two benefits:

- no copying to the system directory needed, which means you dont need to copy
the DLL each time you recompile the engine with changes you make to it.
- updates to the lib directory with your own version of Irrlicht engine, if you
choose to recompile it, are automatic,

Of course simply copying to the system directory is easier to do in a pinch,
besides being hassle free.

And in case you are wondering.... use a batchfile to set enviroment
variables.

Hope this helps....

cc

Posted: Tue Apr 06, 2004 8:05 am
by Domarius
I totally agree with you, Codechief.

But I generally give the simpler solutions when I can't asses their level of technical knowlege.

Posted: Sat Apr 24, 2004 8:42 am
by fritz
I am including the latest version of the Irrlicht.lib and irrlicht.dll but it gives me the same error... I have the lib file in my system32 directory, my project directory and in C:\Program Files\Microsoft Visual Studio\VC98\Lib\

and i still get the error