编译 c++ 时出错带有 g++ 的代码

发布于 2024-09-06 03:53:35 字数 176 浏览 3 评论 0原文

我收到此类错误:
“在函数中...的多重定义”
“...首先在这里定义”
“警告:符号大小...在“

*代码使用以下标志编译:-ansi -Wall -pedantic-errors -Werror
*使用STL

对此有什么解释吗?
先感谢您

i get error of this type:
"in function ... multiple definition of ..."
"... first defined here"
"warning: size of symbol ... changed from to in "

*the code is compiled with the flags: -ansi -Wall -pedantic-errors -Werror
*STL is used

is there any explanation for that?

thank you in advance

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

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

发布评论

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

评论(1

花想c 2024-09-13 03:53:35

解释?您引用的错误消息已经是尽可能详尽的解释。某些东西(变量)在同一范围内被定义多次。编译器为您提供了有问题的变量的名称。编译器在第二个定义处报告了错误,并提供了一条指出第一个定义的附加消息。这就是您查找问题所需了解的全部内容。这里还要解释什么?

Explanation? The error message you quoted is already an explanation as exhaustive as it can ever get. Something (a variable) is defined more than once in the same scope. The compiler gave you the name of the offending variable. The compiler reported the error at the second definition and supplied an additional message that points out the first definition. That's everything you need to know to find the problem and then some. What more to explain here?

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