why Window disappears when i start executing?

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
chaiein
Posts: 30
Joined: Wed Apr 11, 2012 6:51 am

why Window disappears when i start executing?

Post by chaiein »

The helloworld program weh executed in visual studio c++ 2008 it works well but I created new project win32 console application with different name and location, with the main.cpp code as in Helloworld I cannot see the output because window disappears immediately. I have copied irrlicht.dll to the project location.
What should i do to make window not to disappear and why it happening so?
utunnels
Posts: 37
Joined: Thu Apr 05, 2012 2:52 pm

Re: why Window disappears when i start executing?

Post by utunnels »

It is possible the project has different setting with your previous one. For example, if you run the application in visual studio, check the working directory in the project properties tab, that is where your dll should be located.
chaiein
Posts: 30
Joined: Wed Apr 11, 2012 6:51 am

Re: why Window disappears when i start executing?

Post by chaiein »

I am not getting any warning about dll but window disappear I checked the properties with helloworld but still problem exist.
chaiein
Posts: 30
Joined: Wed Apr 11, 2012 6:51 am

Re: why Window disappears when i start executing?

Post by chaiein »

I created the project in the following procedure in visual studio c++ 2008
new->project->vc++ project->win32 console application.
Is this procedure correct?
utunnels
Posts: 37
Joined: Thu Apr 05, 2012 2:52 pm

Re: why Window disappears when i start executing?

Post by utunnels »

OK, then it is the model file.

IAnimatedMesh* mesh = smgr->getMesh("../../media/sydney.md2");

You should place that in correct location if you haven't modified the path.
chaiein
Posts: 30
Joined: Wed Apr 11, 2012 6:51 am

Re: why Window disappears when i start executing?

Post by chaiein »

Ya thats exactly where i had problem. Now it works fine. Thank you so much:)
chaiein
Posts: 30
Joined: Wed Apr 11, 2012 6:51 am

Re: why Window disappears when i start executing?

Post by chaiein »

now i got same probelm of closing window without opening the command prompt to take input from user as in quake3. what should i do ?
byllgrim
Posts: 9
Joined: Mon May 28, 2012 12:13 pm

Re: why Window disappears when i start executing?

Post by byllgrim »

utunnels wrote:OK, then it is the model file.

IAnimatedMesh* mesh = smgr->getMesh("../../media/sydney.md2");

You should place that in correct location if you haven't modified the path.
It works for me if I change it to

IAnimatedMesh* mesh = smgr->getMesh("D:\irrlicht-1.7.3/media/sydney.md2");

How can I edit the settings so that I wont have to do that?
CuteAlien
Admin
Posts: 9694
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: why Window disappears when i start executing?

Post by CuteAlien »

byllgrim: Which IDE? What are you doing exactly?
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
byllgrim
Posts: 9
Joined: Mon May 28, 2012 12:13 pm

Re: why Window disappears when i start executing?

Post by byllgrim »

I am trying to run the hello world tutorial using visual studio 2010. The code is correct because I have tried to copy it from the examples and coping from the tutorial page. Either if I start an ampty project or a console application, the program will compile, run, open up a window and immediately close. I have set the path to include and library. The problem is that it wont recognize where this is ---> ("../../media/sydney.md2");
so i have to type in this ---> ("D:\irrlicht-1.7.3/media/sydney.md2");
I guess there is some way to set a path so it will find the media folder or perhaps I have to move the media files to the project folder, but I don't know how to do this.
CuteAlien
Admin
Posts: 9694
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: why Window disappears when i start executing?

Post by CuteAlien »

Yes, there is a setting in VisualStudio properties for the project. If you use the project files coming with Irrlicht examples it's set already. I'm not on Windows right now, so not 100% certain how the setting is called. It's in the project settings and probably in the common section - most likely it's called working directory (or maybe executable directory or debug directory) ... any name that sounds a little bit like that.

Edit: Not in the general settings, it's in Configuration Properties - Debugging in VS2010
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply