marceloatg
marceloatg

Reputation: 555

Visual C++ if statement. The breakpoint will not currently be hit

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?

Upvotes: 3

Views: 1035

Answers (1)

Dmitry Kazakov
Dmitry Kazakov

Reputation: 1669

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.

Upvotes: 2

Related Questions