Ошибка R6010. Почему это называется?

Я создаю основную 2D-игру. Мой код прекрасно работает в Visual Studio 2010. Однако, когда я создаю .exe и запускаю его, я получаю сообщение о том, чтоОшибка отладки, R6010, Abort был вызван ".

Начав с нуля и добавив кусочки кода, пока я не найду ошибку, я сузил проблему до кода ниже. Я включил всю функцию, но могу предоставить больше кода при необходимости.

Ответы на вопросы других людей показывают, что проблема связана с тем, что ошибка не обнаруживается (я экспериментировал с операторами try / catch безрезультатно). Однако я не могу видеть, где, как код работает без них в режиме отладки.

Если у кого-то есть какие-либо предложения, я был бы очень признателен.

  void initGUI()
{

//Button Types correspond to which section of the screen the button will be displayed in. 
//type 1 = Top Bar,
//type 2 = Main Body,
//type 3 = Overlay window (gui1 only)

bool endFile = false;
string totalGUIString;
string text;
vector stringVector;

//Open the file
cout < "Opening file buttons.txt" < endl;
fstream textFile;
textFile.open("buttons.txt");

//Read the first line and determine the amount of GUI's that need to be created
textFile >> totalGUIString;
int totalGUIs = convertStringToInt(totalGUIString);
cout < "Total number of GUI's to load = " < totalGUIs < endl;

//Create the correct amount of GUI's
for(int j = 0; j < totalGUIs; j++)
{
    guiMatrix.push_back(gui(j));
}

textFile >> text;

while(endFile == false) //Search through the main body of the file
{
    //textFile >> text;

    if(text == "END") 
    {
        endFile = true;
        cout < "Reached the end of the file" < endl;
    }
    else
    {
        stringVector.push_back(text);
        //cout < "PushBack:"  < text < endl;

        if(text == "E")
        {
            //Use vector to populate the button constructor
            int button0 = convertStringToInt(stringVector[0]);
            int button1 = convertStringToInt(stringVector[1]);
            string button2 = stringVector[2];
            int button3 = convertStringToInt(stringVector[3]);

            //cout < "TESTING:: " < button0 < " " < button1 < " " < button2 < " " < button3 < endl;

            guiMatrix[button0].addButton(button1, button2, button3);

            stringVector.clear();

        }

        textFile >> text;
    }
}

textFile.close();

//For every guiMatrix print the button list to cout. 
for(int a = 0; a < totalGUIs; a++)
{
    guiMatrix[a].printButtonMatrix();
}
} 

Ответы на вопрос(1)

Ваш ответ на вопрос