gmcerveny
gmcerveny

Reputation: 191

#define in precompiled header not recognized in .mm files

Why would a #define statement in a .pch not be recognized by .mm files?

Results in "use of undeclared identifier" and "not declared in this scope" when attempting to reference the macro.

Pch looks like this:

#import <Availability.h>

#ifndef __IPHONE_3_0
#warning "This project uses features only available in iPhone SDK 3.0 and later."
#endif

#ifdef __OBJC__
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#endif

#ifdef DEBUG
#define dNSLog(...) NSLog(@"%s %@", __PRETTY_FUNCTION__, [NSString stringWithFormat:__VA_ARGS__])
#else
#define dNSLog(format, ...)
#endif

Upvotes: 0

Views: 1280

Answers (2)

Aur&#233;lien Bottazini
Aur&#233;lien Bottazini

Reputation: 3309

I had the same problem, cleaning was not solving it.

After closing and restarting Xcode 4 everything was fine. If that can help someone...

Upvotes: 3

gmcerveny
gmcerveny

Reputation: 191

Turns out Xcode 4 wasn't actually cleaning the build. :(

Upvotes: 0

Related Questions