已经定义的错误&无限循环

发布于 2025-01-05 03:03:52 字数 659 浏览 6 评论 0原文

当我输入错误的输入时,我会陷入无限循环。我想知道如何避免这种情况,所以我可以输出重新输入您的答案,然后让它重新输入输入。

另外,我在 Visual Studio 2010 中遇到问题,

我在 Quincy 中运行代码正常,然后我想添加声音,我找到了一个使用 Visual Studio 执行此操作的教程。我用另一个代码进行了声音测试,音乐奏效了,所以我知道不是那样的,或者至少是这样认为的。我现在在 Visual Studio 中看到的问题(在 Quincy 中没有遇到过)是以下错误:

1>stats.obj :错误 LNK2005:“public: __thiscall pokemon::pokemon(int,int)” (??0pokemon@@QAE@HH@Z) 已在 Mainirk.obj 中定义

1>c:\users\taylor\documents\visual studio 2010\Projects\irkling\Debug\irkling.exe:致命错误 LNK1169:找到一个或多个多重定义符号

这是我的代码: http://pastebin.com/MHWfQ8WF

I'm having an infinite loop when I enter any wrong input. I'm wondering how to avoid this, so I can just output retype your answer then let it re-enter the input.

Also I am having problems in Visual Studio 2010,

I ran the code fine in Quincy, I then wanted to add sound and i found a tutorial in doing so by using Visual Studio. I performed a sound test with another code, and the music worked, so I know its not that, or at least think. The problem that I see now in visual Studio, that I didn't have in Quincy, are these errors:

1>stats.obj : error LNK2005: "public: __thiscall pokemon::pokemon(int,int)" (??0pokemon@@QAE@HH@Z) already defined in Mainirk.obj

1>c:\users\taylor\documents\visual studio 2010\Projects\irkling\Debug\irkling.exe : fatal error LNK1169: one or more multiply defined symbols found

Here is my code: http://pastebin.com/MHWfQ8WF

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

感情废物 2025-01-12 03:03:52

上面的函数在两个地方定义,一个在 main.cpp(或你的主文件)中,另一个在 stats.cpp 文件中。请检查你的代码,或者你也可以发布它。

谢谢

The above function is defined at two places one in the main.cpp(or your main file) and other in stats.cpp file.Please check your code or you can post it as well.

Thanks

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文