0

I try to add -U__STRICT_ANSI__ to my project build settings in XCode. But if I add it as "preprocessor macros" the commandline result is -DU__STRICT_ANSI__. XCode adds automatically "D". If I add it e.g. to OTHER_CPLUSPLUSFLAGS -> XCode ignores this flag.

Do anybody know there to add a "undef"-preprocessor flag ( e.g. __STRICT_ANSI__) in XCode 4.2?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Monotomy
  • 554
  • 1
  • 6
  • 24

1 Answers1

1

I'm currently running XCode 5.0.2, but I believe the answer will be similar...

  1. Open up your .xcodeproj file.
  2. Click on "Build Settings".
  3. Scroll to "Apple LLVM 5.0 - Custom Compiler Flags". (This step will probably be different for XCode 4.2. The section may also be called "Apple LLVM compiler 3.0 - Language".)
  4. Click on "Other C Flags", and hit the return key.
  5. Type -U__STRICT_ANSI__ and hit return again.

These steps should cause XCode to set the -U__STRICT_ANSI__ compiler flag. There's a nice illustration in this other Stack Overflow post: Xcode Project-Wide compiler flag

Community
  • 1
  • 1
godel9
  • 7,340
  • 1
  • 33
  • 53
  • But there is only a point CXX FLAGS and that i have already tried. I think there is something other not correct - i have added the flag to the warning flags and from there it works now. Thanks for spend your time! If i have found the problem, i will post it! – Monotomy Nov 19 '13 at 17:17