简体   繁体   English

在XCode 4中构建静态库奇怪的错误

[英]Building static library weird error in XCode 4

I'm trying to build a static library but i get compile-time errors such as: Unknown type name UIImage or Unknown type name CGSize . 我正在尝试构建一个静态库但我得到编译时错误,例如: Unknown type name UIImageUnknown type name CGSize

I have added both UIKit and CoreGraphics frameworks to Link Binary With Libraries . 我已将UIKitCoreGraphics框架添加到Link Binary With Libraries What am I doing wrong ?? 我究竟做错了什么 ??

If it's compile time errors then it's nothing to do with the libraries you're linking against. 如果它是编译时错误,则它与您链接的库无关。 This error sounds very much like you haven't included the UIKit headers. 这个错误听起来非常像你没有包含UIKit标题。 Make sure that you have #import <UIKit/UIKit.h> in the files that you're using UIImage and CGSize in. 确保您在使用UIImageCGSize的文件中有#import <UIKit/UIKit.h>

The libraries are relevant during the linking phase only. 这些库仅在链接阶段相关。 For the compilation, the import statements are relevant. 对于编译, import语句是相关的。

Most likely you are missing: 很可能你错过了:

#import <UIKit/UIKit.h>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM