错误R6010。为什么叫它?

用户名

我正在创建一个基本的2D游戏。我的代码在Visual Studio 2010中运行良好。但是,当我创建一个.exe并运行它时,我收到一条消息,提示“调试错误,R6010,已终止中止”。

通过从头开始并添加一些代码直到发现错误,我将问题缩小为以下代码。我已经包含了整个功能,但是如果需要的话可以提供更多的代码。

对其他人的问题的回答表明,问题与未捕获到的错误有关(我尝试过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<string> 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();
}
} 

输入的文本文件如下所示:顶部的数字定义了我要创建的GUI页面数。每个条目的格式如下:页码,位置句柄,名称,生效时间,结束

5

0 2 Explore 0 E
0 2 Technologies 0 E
0 2 Buildings 0 E
0 2 Workers 0 E

0 1 Scoop_Water 10 E
0 1 Collect_Water 10 E
0 1 Forage 10 E
0 1 Gather_Twigs 10 E
0 1 Fell_Trees 10 E

1 2 Enter 0 E

1 1 Build_Road 1 E

2 2 Explore 0 E
2 2 Main 0 E
2 2 Buildings 0 E
2 2 Workers 0 E

2 1 Backpack 0 E
2 1 Hand_Cart 0 E

3 2 Explore 0 E
3 2 Main 0 E
3 2 Technologies 0 E
3 2 Workers

3 1 Build_Hut 0 E

4 2 Explore 0 E
4 2 Main 0 E
4 2 Technologies 0 E
4 2 Buildings 0 E


END
用户名

.png无法找到文件时,将引发错误。.exe.没有规定如果找不到这些文件该怎么办。

通过将相关.png文件移动到与可执行文件相同的文件夹中来解决。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

为什么我可以叫.between?Fixnum方法?

来自分类Dev

错误R6010。为什么叫它?

来自分类Dev

链接列表:无法访问最后一个节点,获得R6010(C ++,VS2010)

来自分类Dev

std :: thread导致应用程序中止,错误为R6010

来自分类Dev

Android:为什么这样叫“无效”区域?

来自分类Dev

什么叫int()?

来自分类Dev

viewdidAppear:为什么我必须叫超级?

来自分类Dev

为什么叫iota?

来自分类Dev

While循环导致错误R6010 Visual C ++ Express 2013

来自分类Dev

什么是__方法__,为什么叫__getattr__?

来自分类Dev

我叫它时下面方法的参数是什么

来自分类Dev

为什么叫ROM?

来自分类Dev

为什么DrRacket似乎将其识别为尾叫?

来自分类Dev

为什么它似乎调用错误的方法?

来自分类Dev

为什么即使我安装了它需要的所有东西,也为什么在buildozer中不断收到此错误消息?

来自分类Dev

什么叫paintComponent()?

来自分类Dev

完美运行时调用了QT调试错误r6010中止

来自分类Dev

尝试在C ++中拆分字符串,但始终收到错误R6010

来自分类Dev

R6010 abort()已被调用

来自分类Dev

调试错误。R6010中止已被调用()

来自分类Dev

什么叫“-”?

来自分类Dev

为什么Destructor叫Three Time?

来自分类Dev

为什么asp.net MVC叫轻量级?

来自分类Dev

当我向线程分配承诺时,C ++收到“调试错误R6010 -abort()已被调用”的信息

来自分类Dev

为什么叫d'tor,尽管不叫?

来自分类Dev

斯威夫特:为什么它错误地更新了高分?

来自分类Dev

我不明白为什么它说 ArrayOutOfBound 错误

来自分类Dev

为什么叫 Hirsute 而不是 Hairy?

来自分类Dev

为什么叫响应文件

Related 相关文章

热门标签

归档