Skip to main content
gamedev.net
🔒 Locked

Compilation Problem

Started by discman1028 Apr 4, 2006 at 11:45 PM 4 replies 1.2k views
Original Post
discman1028
discman1028
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.
--== discman1028 ==--
extralongpants
extralongpants
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.
discman1028
discman1028
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!)
--== discman1028 ==--
RDragon1
RDragon1
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...
discman1028
discman1028
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... ;-/
--== discman1028 ==--

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.