Reputation: 12549
I just created a new cocoa project on Xcode 4.3.3. The preprocessor macros for the Apple LLVM compiler 3.1 settings have a DEBUG=1 $(inherited) value assigned. I removed it and add it again, and now I'm getting an error when compiling :
clang: error: no such file or directory: 'DEBUG=1'
I search for the value on the project settings and I saw that the value is also defined in "Other warning flags"
My questions are:
DEBUG
vs DEBUG=1
?$(inherited)
do?Upvotes: 1
Views: 1910
Reputation: 78343
First, if you're getting a compilation error, then you most likely put the macro back in the incorrect place in the project settings. Please ensure you've put it into the Debug
configuration branch of the Preprocessor Macros
item under the Apple LLVM compiler x.x - Preprocessing
section.
For your other questions:
DEBUG
so it's essentially empty. You can test for whether it exists or does not exist, but not much. The second sets it to 1
so that the preprocessor can actually do comparisons like #if DEBUG && SHOULD_DIE_ON_ERROR
where you might abort if the application comes across some validation error, but only if SHOULD_DIE_ON_ERROR
is set and 1
and you're running in debug mode.$(inherited)
just brings in other macros you're inheriting from further up the chain. So if your project defines some items and your target defines some more, the target gets the project's settings as well without having to re-define them.Upvotes: 1