开发者

#define in precompiled header not recognized in .mm files

开发者 https://www.devze.com 2023-02-25 17:42 出处:网络
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.

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 i开发者_运维知识库n 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


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

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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消