As I wrestle with completing the shippable
versions of Hero Roller and Hero Roller Lite, I come upon a bizarre
unpleasantness. Moving rapidly between Release, Debug, and Distribution
versions of my projects, suddenly XCode responds to a build command with a huge
list of errors which basically say "there's something wrong with your PCH
file". Putting an extra warning flag (-Winvalid-pch) provides the
not-very-much-more-useful error that includes the magic phrase "not
used because `DEBUG' is defined".
A google search turns up
one conversation on the subject from June
2003. It's discussing a workaround
that involves being concerned with specific locations of include files and the
order that directories are searched and just seems like a lot to deal
with. And probably brittle,
besides.
Then it hits me.
If the problem is because DEBUG is defined, I infer that the
issue is somehow whether the PCH file and my working project agree on whether
DEBUG is defined. And that can
only happen if I ever define DEBUG.
So I won’t.
Instead of using DEBUG as my preprocessor flag, I’ll use
ER_DEBUG.
That fixes the problem.