3

I'm using Visual Studio 2013, programming in C++ and have a base class with the following attribute:

ref class AI
{

...

protected:

   /// <summary>
   /// Exit found flag. False if exit is yet to be found, true if it already was.
   /// </summary>
   bool exitFound;

...

}

Within the derived class I have the following code:

void AI_II::analyze(void)
{

...

        this->exitFound = true;

        if (this->exitFound)
        {
            if (this->distFront->lastTile == EXIT){...}
            else if (this->distDown->lastTile == EXIT){...}
            else if (this->distBack->lastTile == EXIT){...}
            else if (this->distUp->lastTile == EXIT){...}
        }

...

}

And I don't know how, but when running or debugging, the if (this->exitFound) statement is always skipped. When debugging I get the "The breakpoint will not currently be hit..." message.

I already tried to clean the solution, but no success so far. Anyone can help me find what is wrong?

1

1 Answer 1

2

Select in Visual Studio [Properties] - [Build] tab and check [Define DEBUG constant] and [Define TRACE constant] are checked. Also check [Debug Info] is set to [full] in [Advanced] tab.

1
  • 2
    Thank you for the advice! It was just a compiler optimization problem.
    – marceloatg
    Jul 19, 2015 at 5:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.