简体   繁体   English

为什么Xcode 3会为每个实际发生的事件显示多个编译器错误或警告

[英]Why is Xcode 3 displaying multiple compiler errors or warnings for each that actually occurs

When I build in Xcode, any errors or warnings are being duplicated. 当我构建Xcode时,任何错误或警告都会被复制。 So in the IDE, I get twice the number near the icons in the status bar, and where the yellow or red bubbles show up in the editor, there are two warning lines (or error lines) below the line where the warning (or error) occurred. 因此,在IDE中,我在状态栏中的图标附近获得两倍的数字,并且在编辑器中显示黄色或红色气泡的位置,警告(或错误)行下方有两条警告线(或错误行) ) 发生了。 Anyone else have this problem, or know how to fix it? 其他人有这个问题,或知道如何解决它?

Are you doing a release build? 你在做发布版吗? If so, it may be hitting the errors once while doing the PPC build, and again for the intel build. 如果是这样,它可能在执行PPC构建时遇到错误一次,并且再次用于intel构建。

When GCC is run with multiple -arch flags, it will produce a warning and/or error for each architecture because the compiler is essentially being run multiple times. 当GCC运行多个-arch标志时,它将为每个体系结构产生警告和/或错误,因为编译器基本上是多次运行的。

If you have set your project to be a Universal app containing both PPC and i386 binaries then you will get two errors/warnings, provided that the error/warning applies to both architectures. 如果您已将项目设置为包含PPC和i386二进制文件的通用应用程序,那么您将收到两个错误/警告,前提是错误/警告适用于这两种体系结构。

The above answers are correct but don't tell how to fix it. 以上答案是正确的,但不告诉如何解决它。 Go to Project -> Edit Project Settings, and check the "Build Active Architecture Only" button in the Architectures section. 转到项目 - >编辑项目设置,然后选中“体系结构”部分中的“仅构建活动体系结构”按钮。 Why Apple doesn't check this by default for debug projects is beyond me. 为什么Apple默认情况下不会对调试项目进行检查。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM