• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
OTHER_CFLAGS being silently ignored
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

OTHER_CFLAGS being silently ignored


  • Subject: OTHER_CFLAGS being silently ignored
  • From: Greg Hurrell <email@hidden>
  • Date: Thu, 12 Dec 2002 03:57:14 +1030

Has anyone else ever had a problem with the OTHER_CFLAGS field in Project Builder's Expert build settings silently ignoring the settings?

Specifically, I have a line like this in my OTHER_CFLAGS build settings:
-DDEBUG

And then in my source code I have an #ifdef DEBUG block... the problem is, I never get inside the #ifdef block.

I've done some experimentation and found out the following about the weird behaviour:

1. It makes no difference whether the OTHER_CFLAGS field is preceded by an "=" sign or a "+=" sign in the Project Builder expert settings interface.

2. The WARNING_CFLAGS field is also having no effect -- I can put anything in there and it makes no difference to the options that are passed to the compiler.

3. By turning up the build log detail and looking at the output I can see that the flags simply aren't being passed to the compiler at all.

4. If I insert a #define DEBUG into my code, then I can see a -DDEBUG flag being passed to gcc in the build log! The debug code gets compiled in.

5. If I clear the OTHER_CFLAGS field and leave the #define DEBUG statement in the code, then I see no -DDEBUG flag being passed to gcc in the build log, but the debug code still gets compiled in.

6. If I put -DDEBUG back into the OTHER_CFLAGS field and leave the #define DEBUG statement in the code then not only does the debug code get compiled in, but gcc warns me that I've got a redeclaration of the DEBUG value (ie. it gets it passed it on the command line AND it reads it from the source file...)

7. If I create a brand new test project and set -DDEBUG in the OTHER_CFLAGS field, then it works as expected (the #ifdeg DEBUG test works)

Any suggestions as to what could help me to fix this bizarre and annoying behaviour? I've already wasted several hours trying to trouble shoot it...

Cheers
Greg
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: OTHER_CFLAGS being silently ignored
      • From: Jeff Disher <email@hidden>
  • Prev by Date: Re: Setting the image on a pop up button
  • Next by Date: Re: question on bundles and frameworks...
  • Previous by thread: Re: CF Portability
  • Next by thread: Re: OTHER_CFLAGS being silently ignored
  • Index(es):
    • Date
    • Thread