Advertisement

Program will only execute through compiler

Started by May 03, 2001 05:34 PM
7 comments, last by CTRL_ALT_DELETE 23 years, 8 months ago
Hello, I have written a simple DirectX program. It will compile and run in VC++, but the actual .exe file in the ''debug'' folder crashes to the desktop each time I execute it. I don''t think its any thing wrong with my code, as this happens to other DX programs that I have taken out of books. So, I must have something configured wrong in VC++ or there are some missing files in the programs directory or something like that. Thanks for any help.
Are you using Visual C++ Intro Edition? You can''t run executables made with that. You have to compile/execute the code every time. If that''s the problem, go buy VC++ Standard. It''s only $99 USD.
Advertisement
Hey,
If you''re loading graphics in your program, they need to be inside the debug folder when you run it from there but not when you run it from the compiler...

That might be a problem...

--Nairb
--Thanks Nairb, that is exactly what I needed.
--SomeGuy, I have the intro edition and can run .exe files outside the compiler--just thought i would let you know (but i plan to get the actual edition soon to get rid of those pesky pop-ups).
Odd. Refuses to do it for me. Maybe I have a problem then (another?).
Actually, a better idea is not to bother moving your graphics, but to set the options so that the final executable is placed in the root directory instead of the debug directory.

~CGameProgrammer( );

~CGameProgrammer( ); Developer Image Exchange -- New Features: Upload screenshots of your games (size is unlimited) and upload the game itself (up to 10MB). Free. No registration needed.
Advertisement
Write down the complete search path when you load your files. Use double "\" letters in the string or the debugger think you are typing a format option (this syntax dosn´t apply to #include statement).

You can also put your source files in diffrent directorys to get a better structure in your project. If you want to include a file called "gfx.h" that lies in a map called "AppName/Graphic", (in your current directory) you can simply write:

  #include "..\Graphic\gfx.h"  


But if you write to a file in that directory and want to include a header file called "main.h" in the current directory you must write:

  #include "..\main.h"  





Zeblar Nagrim, Lord of Chaos
If you move the location of the final exe, you might get stompage when you do release as opposed to debug builds...

plus all that crap it makes while compiling will pollution your source :p Or can you set it up to drop the exe to a different path than the .obj stuff?

Magmai Kai Holmlor
- The disgruntled & disillusioned
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
The executable''s directory is seperate from the build directory. But by default, they''re both in Debug\ or Release\. I have it so intermediate files (*.obj) are in the Build\ directory, and the *.exe or *.dll files are in the root directory.

~CGameProgrammer( );

~CGameProgrammer( ); Developer Image Exchange -- New Features: Upload screenshots of your games (size is unlimited) and upload the game itself (up to 10MB). Free. No registration needed.

This topic is closed to new replies.

Advertisement