# Release mode

This topic is 4589 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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...

##### Share on other sites
The usual reason for different behavior between release and debug configurations is uninitialized variables.

##### Share on other sites
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 ;)

##### Share on other sites
Alright, i'll check that out when i go home

##### Share on other sites
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.

##### Share on other sites
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).

##### Share on other sites
how do i enable this "Generate debug info"?

##### Share on other sites
oh and i just checked, i never define "_DEBUG".. so i don't know y i keep getting errors or whatever..

##### Share on other sites
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 :)

##### Share on other sites
Quote:
 Original post by EvilKnuckles666oh 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

assert( pollKeyBoardEvents() != false );