I might be a lil' late to this party, but same problem, solved it by going to Product > Scheme > Manage Schemes... Then simply delete current scheme and recreate a new one then try building again.
This is a good way of resetting any compilation settings you might have inadvertently changed.