0

After updating to Xcode 5.1, I am having a compile time fatal error on my project that I am not fully understanding.

clang: error: unknown argument: '-force_load GoogleAnalyticsServices' [-Wunused-command-line-argument-hard-error-in-future]

Is this a hard error because -force_load is no longer needed in 5.1, or is there something I'm overlooking (e.g. spelling error, missing file)

JoeCortopassi
  • 5,083
  • 7
  • 37
  • 65
  • Possible duplicate of http://stackoverflow.com/questions/22313407/clang-error-unknown-argument-mno-fused-madd-python-package-installation-fa/22372751#22372751 – Eduardo Apr 25 '14 at 17:10
  • So why is `-force_load` is no longer needed in 5.1? – pronebird Apr 26 '14 at 13:24

3 Answers3

0

Try removing the -force_load GoogleAnalyticsServices from your target Build Settings' OTHER_LDFLAGS (Other Linker Flags).

You can also just search for GoogleAnalyticsServices in the same window.

Rivera
  • 10,792
  • 3
  • 58
  • 102
  • I'm pretty sure yu can remove it in both. Why would you use 5.0 and not 5.1? ;) – Rivera Apr 24 '14 at 04:59
  • what I'm asking is, why would it need to be there in 5.0, but is safe to remove in 5.1? I know deleting it makes the error go away, but so does wiping out all my files and having a blank project. – JoeCortopassi Apr 26 '14 at 18:11
0

Xcode 5 caused clang to throw a fatal error when it encountered an unknown command line flag, which broke a lot of things.

Add this to your ARCHFLAGS flags in Xcode. -Wno-error=unused-command-line-argument-hard-error-in-future

Jonathan Howard
  • 216
  • 1
  • 10
  • Doesn't this just suppress the error, rather than solve the problem? – JoeCortopassi Apr 24 '14 at 02:38
  • @JoeCortopassi if the problem is with upstream libraries, I prefer to suppress it and leave the fixing of the problem to them. Note that the 5.1 change just changed that from a warning to an exception–so the code was invalid in the first place. I would add this to your arch flags and put in a issue with the library maintainers. – Jonathan Howard Apr 24 '14 at 21:08
  • @justin Punting the issue to the library maintainer doesn't mean my code is any better. Just hides the actual problem – JoeCortopassi Apr 26 '14 at 18:12
0

From my investigation it seems as if you have added single quotes around the value of Other Linker Flags in your project's Build Settings.

Xcode is then trying to interpret the entire line as a flag/argument.

Try removing the quotes, if they exist

Max Chuquimia
  • 7,494
  • 2
  • 40
  • 59