已经定义的错误&无限循环
当我输入错误的输入时,我会陷入无限循环。我想知道如何避免这种情况,所以我可以输出重新输入您的答案
,然后让它重新输入输入。
另外,我在 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
上面的函数在两个地方定义,一个在 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