Jump to content
  • Advertisement
Sign in to follow this  
discman1028

Compilation Problem

This topic is 4515 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

I'm not sure why this is happening all of a sudden, but here's the problem. When I used to compile (D3D apps), an EXE showed up in the Release or Debug directory, and I could execute it just fine. Now, my I cannot run the EXE that is being produced in that folder. In addition, the EXE's now produced have a different icon (same compiler, same codebase). Here is a screenshot of two different-icon EXE's (Bottom one runs ok). The bottom one closes immediately after it is opened. http://www.angelfire.com/retro/there/howcome.html Both applications are Win32 Apps, and also open a console to print to, using: AllocConsole(); freopen("CONOUT$","w",stdout); The one that closes immediately shows the console and some preliminary program output before closing down. Both programs run fine within Visual Studio 2003, by the way. Any ideas? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Windows console applications don't actually wait for the user to press a key before shutting down. If you run the app inside of Visual Studio, the IDE will often insert a "press any key to continue" message for you, but that's only there for debugging purposes. If you want to be sure to see a console program's output, ask the user to press a key a couple of times manually at the end of main (sometimes just one doesn't work), or run the program in a command prompt.

Hope that helps. Good luck.

Share this post


Link to post
Share on other sites
Sorry -- I should be more clear. This is a Direct3D application. It has a Winmain(). It opens up a Win32 window, and animates a scene. In addition, I open up a console via:

AllocConsole();
freopen("CONOUT$","w",stdout);

I've never had the problem of the console closing immediately. (Well, I have had that problem with all console applications, but not with this Win32 Direct3D application that opens up a console.)

i.e. I got rid of my console:

// AllocConsole();
// freopen("CONOUT$","w",stdout);
...
// FreeConsole();

and no window even opens at all! (A Direct3D app should open, as it does within Visual Studio!)

Share this post


Link to post
Share on other sites
Does it run? Does it give you an error message?

Maybe running it from the /debug/ directory is bad - are there any data files that need to be in the working directory of the app when it's run? Check project settings > debug to see what the working directory is set to when you launch with the debugger...

Share this post


Link to post
Share on other sites
Well, someone's thinking straight, and it isn't me! Thanks RDragon1. I forgot I needed the texture I'm loading to be in the working directory... doh! I guess it had nothing to do with that different icon... ;-/

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!