Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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. 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. Anyone else have this problem, or know how to fix it?

like image 738
Joshua Kifer Avatar asked Jan 19 '09 02:01

Joshua Kifer


3 Answers

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.

like image 51
Ben Gottlieb Avatar answered Nov 24 '22 06:11

Ben Gottlieb


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.

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.

like image 45
dreamlax Avatar answered Nov 24 '22 04:11

dreamlax


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.

like image 39
schillace Avatar answered Nov 24 '22 06:11

schillace