1

Since upgrading to Xcode 5.1 this morning, a C++ library I have included in my project is failing to build due to unused const.

I have Treat Warnings as Errors: NO & Pedantic Warnings: NO

Any ideas?

Edit after request for line!:

const int NPT_SSDP_MAX_LINE_SIZE  = 2048;

full warning is: Shell script Invocation Error Unused variable 'NPT_SSDP_MAX_LINE_SIZE'

Nick Hingston
  • 8,724
  • 3
  • 50
  • 59

3 Answers3

4

In my case, the -Werror flag was set in Build Settings, Other Warning Flags. I just removed -Werror.

Chris Prince
  • 7,288
  • 2
  • 48
  • 66
3

Do you have any warning about "Validate Project Settings" in your project?. Similar error went away after update to recommended settings and compile again.

nnarayann
  • 1,449
  • 19
  • 24
  • Don't get why, but yes this worked! Have linker issues now..but 1 step further, thanks! – Nick Hingston Mar 11 '14 at 11:16
  • Actually, in addition to this - I needed to set treat warnings as errors to NO on the top level project, not just the relevant target(s) – Nick Hingston Mar 11 '14 at 11:25
  • Where does the validate project settings button appears? Seems that I keep seeing it occasionally, but not now – Alex Stone Mar 25 '14 at 16:33
  • @AlexStone It's not a button, it's a warning you can see in the navigator panel. See [image](http://i.imgur.com/HcLsBtY.png) – nnarayann Mar 27 '14 at 10:24
2

In my case this error was caused by a sub-project within the main project having "Treat warnings as errors" set to YES.

To fix:

  • Go to build settings for your main project or sub-project (search for .xcodeproj to find all subprojects)
  • type in warnings into search box
  • Set "treat warnings as errors" to NO

enter image description here

This fixed my issue for xCode 5.1

Alex Stone
  • 46,408
  • 55
  • 231
  • 407