I want to break when test2 is true. It won't let me set a breakpoint inside the conditional where test2 is set to true. So I tried to put a conditional breakpoint below where test3 is declared:
string teststring = "debug";
bool threedistinct = false;
bool test2 = false;
if(teststring.find("d") != string::npos)
threedistinct = true;
if(threedistinct)
test2 = true;
bool test3 = false;
and I get the following errors:
I don't understand how test2 could be undefined. I tried changing its type to int, initialized it to 1, and change its value in the conditional, but I got the same errors. Note: the errors appear only when I try to set the breakpoint.
"I was accidentally compiling in max liability mode. I changed to Release to Debug and it works. Thanks!"
Glad to know that you have resolved this issue. But I agree with PaulMcKenzie's suggestion, the real issue would be related to certain settings during two different mode which couldn't generate the debugging informaiton.
(1The linker setting which will generate debugging information. (2)Disable the optimizations option.
A reference about the similar issue: