export game

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
younes_kh
Posts: 13
Joined: Wed Jun 24, 2009 8:50 am
Location: Palestine-gaza will be free

export game

Post by younes_kh »

hi
i have finish my game and it run very well when i run it inside visual studio
but when i try to run it from exe file it run and when i chose the mission and start it the game is close , i used code block but no useful

what is solution to make my game run from exe with out stop or close?


please tell me what i can do
:?: :cry: :cry:
Insomniacp
Posts: 288
Joined: Wed Apr 16, 2008 1:45 am
Contact:

Post by Insomniacp »

is the dll and all of the models and textures and fonts placed in the same directory formation as it was when running in visual studio? If you compile it then copy the exe into the main folder of the project then it should run just fine :). I think it is failing to find something and just closes because it can't continue or errors.
Nox
Posts: 304
Joined: Wed Jan 14, 2009 6:23 pm

Post by Nox »

If you run your exe from VS it starts in the directory there the projectfile is placed (normally). If you want to change this you can set a different startdirectory in the projectoptions under the point Debugging. Or you copy the exe/dll into your projectdirectory.
younes_kh
Posts: 13
Joined: Wed Jun 24, 2009 8:50 am
Location: Palestine-gaza will be free

Post by younes_kh »

thank you for replying , i put the exe dll in the main directory but the problem is remain , i thing the problem in irrlicht engine when the game media and source code is became big the engine not work good with the memory .

what your opinions about that ?
Nox
Posts: 304
Joined: Wed Jan 14, 2009 6:23 pm

Post by Nox »

if this were the case it would crash with the IDE too. What is your main directory, where is your projectfile and your exe localed?
DtD
Posts: 264
Joined: Mon Aug 11, 2008 7:05 am
Location: Kansas
Contact:

Post by DtD »

You say you tried moving the files, but I thought I'd post this here anyway (just in case)
This code /should/ resolve your working directory to the folder your EXE resides in. (In Windows anyway)

Code: Select all

irr::io::IFileSystem* filesys = irrDevice->getFileSystem();
filesys->changeWorkingDirectoryTo(filesys->getFileDir(argv[0]).c_str());
(argv would be the command line arguments your application gets when it is started with main "int main(int argc,char* argv[])")

With that you can just put everything where your EXE is.

~DtD
Post Reply