Why do all my local static variables function perfectly in release but not so in debug mode?

TonEpskamp-0986 31 Reputation points
2022-09-29T20:53:14.957+00:00

Many thanks to all of you who helped me to get my release executable running. I discovered this misery when developing a debug version. I could correct all those failures by replacing some of my local statics by globals. Becoming a little frustrated I compiled a release version without those stupid replacements! Big surprise: all my problems melted like snow in the sun. In debug mode I detected the most unexpected (change of) values of my local statics.That was the reason I gave the release mode its chance by compiling a release version. Help me understanding the same code in both debug and release versions responding so incomprehensibly differently. I am using Visual Studio Community 2019. Do I have to replace all my local statics by globals? I don't know of any possibility of increasing the space for local statics? I can't believe in a similar solution because of the perfectly running release mode. I counted 312 local statics.

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,606 questions
{count} votes