A little setup issue (Solved! :)

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
Namespace Irrlightuser
Posts: 9
Joined: Wed Apr 22, 2009 12:06 am

A little setup issue (Solved! :)

Post by Namespace Irrlightuser »

I batch compiled the examples just fine so I decided to make my own project and test out the test code just to get some reference. I copied the code and compiled it, copied the irrlicht and irrKlang.dlls in and ran my project, however this one did something the original Hello World demo did not. When I double clicked the exe it opened for a moment and then closed. I went back and made sure I had copied all the text in and tried again. It blinked on the screen again. I'm using Visual C++ 9 and I'm guessing it's the type of project I create. I've tried a few different types of projects like an empty win 32 project app, console app, empty project, but each time it opens for only a moment.

I'm not sure if it's the type of file I'm creating, or that I'm opening the exe in the debug file, but it's not staying open, like I need to add another command.
(if I shouldn't be running the .exe in the debugger file, which one should I be using?)

*edit* I just compiled it as a release and the issue persists. *edit*
Last edited by Namespace Irrlightuser on Wed Apr 22, 2009 1:08 am, edited 1 time in total.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

well, there is some sort of error with your project (it's probably not the project type, maybe error with code or assets can't be found, latter is the error I guess)...
the problem here is that the program shuts down and closes the window, so you can't see the error message(s)... :lol:
put a system("pause"); at the end of the code, so the program waits for a key stroke when shutting down, then you can see all messages... ;)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Namespace Irrlightuser
Posts: 9
Joined: Wed Apr 22, 2009 12:06 am

Post by Namespace Irrlightuser »

The solution:
I tried adding a system("pause"); to the end of the code, but for some reason it continued exiting. I decided that somewhere in the code it must be returning 0 before it got to the end of the code. I looked around and noticed that it might be the media folder since it had ../../ before the media folder name. I placed a copy of the media folder two folders above the .exe (which happened to be convenient too). The program worked and after I closed the window with alt f4 it waited for me to hit a key to exit. The code for getMesh couldn't load the model and so didn't return 1, which I suppose meant it returned 0 and exited the program.

Thanks Acki! I don't think I would have noticed it without your suggestion :)
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

you're welcome !!! ;)

and it was exactly my thought (missing assets)... 8)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Post Reply