   Program runs perfect in Debug mode has error when just running. Why?
  Folks, I have a nice little game I'm working on and I can't debug a problem because when executing in debug mode, the program runs perfectly.  However, when I just run the executable, the program has an error that is inexplicable.  It's not a seg fault or anything, just seems to be ignoring my logic.I am using DevC++ and writing an opengl game.Is there something wrong with DevC++?  Or is there something wrong with me.  What possible reasons could there be for the program to run perfectly in debug but not in the exe?   
  There's plenty wrong with Dev-C++, although it's not necessarily the problem you're encountering.  Try using printf statements to verify that it's executing your logic.  It could be that the compiler is just too smart for you, and for some reason it's determining that some condition is always true or always false, and that it doesn't need to execute your code.  If you were using Visual C++ Express Edition, I'd say compile in release mode with debug information enabled and see if the problem still exists.  I'm not sure if you can do that with Dev-C++, but if you can I'd try that.Either way, regardless of what the problem is, I'd ditch Dev C++ instantly and get Visual C++ Express Edition   ;Quote:Original post by zer0sumFolks, I have a nice little game I'm working on and I can't debug a problem because when executing in debug mode, the program runs perfectly.  However, when I just run the executable, the program has an error that is inexplicable.  It's not a seg fault or anything, just seems to be ignoring my logic.I am using DevC++ and writing an opengl game.Is there something wrong with DevC++?  Or is there something wrong with me.  What possible reasons could there be for the program to run perfectly in debug but not in the exe?It's probably your code if the same .exe file works when run in the IDE but not when run outside of it. But also, yes, there is something wrong with Dev-C++. I can't speak for Dev-C++, but in many IDEs the program running directory is modified by the IDE. Also, make sure you're checking all error codes from functions you're calling.edit: I assumed you meant that it was the same executable executed in different ways, but it could also be 2 different executables, per cache_hit's comment.   ;Quote:Original post by zer0sumWhat possible reasons could there be for the program to run perfectly in debug but not in the exe?Lots. Search Google for something like "difference between debug and release" and you'll find this issue is quite common. It's usually uninitialised variables which catch me out - in debug mode the compiler initialises them for you but in release mode it doesn't.;  Thanks.  I'll go through and see if there is a problem with initializing critical variables; I'll also try a new IDE.   