Why Won't this work..

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
fritz

Why Won't this work..

Post 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
Electron
Posts: 874
Joined: Sun Mar 14, 2004 12:05 am
Location: Massachusetts USA

Post by Electron »

try running your debugger and see where the program does go
fritz

Post 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
Acki

Post 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
Guest

Post 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...
fritz

Post by fritz »

How would I fix that**
fritz

Post by fritz »

Bleh, It keeps comming out wrong!!!!!! Where do I put the Irrlicht.lib file! There, said it right!
Domarius
Posts: 178
Joined: Thu Mar 11, 2004 9:51 am
Location: Brisbane, QLD, Australia

Post 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.
codechief
Posts: 15
Joined: Thu Apr 01, 2004 1:15 pm
Location: Canada

Post 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
Domarius
Posts: 178
Joined: Thu Mar 11, 2004 9:51 am
Location: Brisbane, QLD, Australia

Post 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.
fritz

Post 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
Post Reply