Release mode

Started by
9 comments, last by DaBono 18 years, 10 months ago
How come whenever i compile my project in release mode, none of my arrow keys work. the space bar and esc key work though. it seesm like the DirectInput just doesn't acquire them or something...
-------------------------Unless specified otherwise, my questions pertain:Windows Platform (with the mindset to keep things multi-platform as possible)C++Visual Studio 2008OpenGL with SFML
Advertisement
The usual reason for different behavior between release and debug configurations is uninitialized variables.
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
Yeah that's a good first thing to try.

Putting important code inside a #ifdef _DEBUG statement is also a bad idea, but that's unlikely to be the cause ;)
Alright, i'll check that out when i go home
-------------------------Unless specified otherwise, my questions pertain:Windows Platform (with the mindset to keep things multi-platform as possible)C++Visual Studio 2008OpenGL with SFML
I have the exact same problem. Strange. I've learned that it's not very fun to debug release code.

Please let me know if you find a solution. Thanks.
_________________________ www.leXor.net
When debuging in release mode in VC you can enable "Generate debug info", if you set it to use a program database you executable will not be affected (the debug information is put in a separate file).
how do i enable this "Generate debug info"?
-------------------------Unless specified otherwise, my questions pertain:Windows Platform (with the mindset to keep things multi-platform as possible)C++Visual Studio 2008OpenGL with SFML
oh and i just checked, i never define "_DEBUG".. so i don't know y i keep getting errors or whatever..
-------------------------Unless specified otherwise, my questions pertain:Windows Platform (with the mindset to keep things multi-platform as possible)C++Visual Studio 2008OpenGL with SFML
Have you come up with a solution yet?

I'm still having this problem, and I don't have anything input-related inside a #ifdef _DEBUG statment or anything like that :)

_________________________ www.leXor.net
Quote:Original post by EvilKnuckles666
oh and i just checked, i never define "_DEBUG".. so i don't know y i keep getting errors or whatever..

Hi Evil,
Depending on how you generate your base project, "_DEBUG" can be defined for you using a "Debug build".
For Instance if you are using Visual Studio 2003 and you have debug build selected then look at:
Select "project" on main menu bar, then "project name" properties.
In the properties dialog, go to
Configuration properties->C\C++->preprocessor.
In that section, check to see if _DEBUG is defined in "Preprocessor definitions".

At the moment, I would go with John Bolton's statement: "The usual reason for different behavior between release and debug configurations is uninitialized variables."

Could you post your code which reads key state, and any code which initializes any variables used in that code?

HTH,
Cambo_frog
For the love of god, please tell me that you've just omitted your error checking code for brevity, and you don't really assume that all those functions succeed.

This topic is closed to new replies.

Advertisement