Question

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?

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top