Sign in to follow this  

Can't Tell the Error

This topic is 4338 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi everyone, I have been working on my game now for a couple of weeks, and have decided to convert it to an exe so that you guys can download it and give me comments. Now when I converted it, everything seemed as if it had gone off fine, but when I double click on the exe, I see the window for about a second and then it closes, but I can't read the error message in the command prompt because it appears and disapears so fast, does anyone have any suggestions for how to be able to see the error message?

Share this post


Link to post
Share on other sites
I assume it is a C++ console application.
The "kosher" way to do it is to open the program in a command prompt. An alternative, though, is to put std::cin.get();, or system( "pause" ); at the end of your main() function. Both functions have their drawbacks (the first may not work depending on the state of the stream, the second is platform-specific and is not guaranteed to do what you think even on the target platform).


jfl.

Share this post


Link to post
Share on other sites
Quote:
Original post by PhlashStudios
How would I do that (I'm not very experienced with console programming)
Go to Start->Run->"command"->OK and then cd to your project directory and run your application by typing in its filename and pressing enter.

Share this post


Link to post
Share on other sites
Quote:
Original post by PhlashStudios
Ok thanks...(its actually a converted python program) If youd like to know how to accomplish this i can easily oblige
What do you mean by "converted"?

Share this post


Link to post
Share on other sites
Quote:
Original post by PhlashStudios
I "froze" the python script into an exe
Oh, then that's beyond me. I gather that there are several members of this community that are knowledgable with Python, so you are sure to find an answer. Good luck.

Share this post


Link to post
Share on other sites
I don't think you're doing exactly what jflanglois said, or the window wouldn't close like you said.

Start Menu -> Run -> type "cmd".
You should now have a console window, waiting for you to enter text.
Type "CD c:\whichever\directory\path". The directory should change to your program's directory. Obviously, adjust the line to match.
Now type "myprogname.exe", again with the name of your program.
It will run and the window won't close. You should see the output there.

What I tend to do myself, is run Python programs from within my text editor, which can then capture the output in a separate window. TextPad, Editplus, Crimson Editor, and pretty much any other free/cheap text editor can do this.

Share this post


Link to post
Share on other sites

This topic is 4338 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this