找不到Cocoa / Cocoa.h(错误) [英] Cocoa/Cocoa.h Not Found (Error)

查看:942
本文介绍了找不到Cocoa / Cocoa.h(错误)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了很多研究,只有当在iPhone上建立一个可可应用程序时,才会发现有人抱怨这个错误。

I have done alot of research on this and only find people complaining about this error when there building a cocoa app on the iPhone.

我最近抓住了源代码Colloquy for Mac,并做了它要求的一切('Cocoa / Cocoa.h'File not found)

I recently Grabbed the source for Colloquy for Mac and did everything it asked and ('Cocoa/Cocoa.h' File not found)

这里是#import的一切代码块。

Here is the chunk of code that #import's everything.

#define ENABLE(FEATURE) (defined(ENABLE_##FEATURE) && ENABLE_##FEATURE)
#define SYSTEM(NAME) (defined(SYSTEM_##NAME) && SYSTEM_##NAME)

#define LIKELY(x) __builtin_expect((x) ? 1 : 0, 1)
#define UNLIKELY(x) __builtin_expect((x) ? 1 : 0, 0)

#define SYSTEM_MAC 1

#ifdef __OBJC__

#ifdef COMMAND_LINE_UTILITY
#import <Foundation/Foundation.h>
#else
#import <Cocoa/Cocoa.h>
#endif

#import "NSCharacterSetAdditions.h"
#import "NSDataAdditions.h"
#import "NSDictionaryAdditions.h"
#import "NSMethodSignatureAdditions.h"
#import "NSNotificationAdditions.h"
#import "NSObjectAdditions.h"
#import "NSScannerAdditions.h"
#import "NSStringAdditions.h"
#endif

#import "MVUtilities.h"

#if !defined(__unsafe_unretained)
#define objc_unretainedObject(object) (id)(object)
#endif



我重新链接了框架,所以没有必要问我是否试了一下。 :)

I have re-linked the frameworks so no need to ask me if I tried that. :)

帮助将非常感谢:D

推荐答案

你试图构建iOS的Colloquy?

Are you trying to build Colloquy for iOS? If you're not, skip the first section.

您的问题是您要导入Cocoa / Cocoa.h 。这真的是两个问题:

Your problem is that you're importing Cocoa/Cocoa.h. This is really two problems:


  1. Cocoa是Mac开发框架。它不存在于iOS上。

  2. iOS没有伞架。没有CocoaTouch.framework作为Mac OS X的Cocoa.framework的对应;对于iOS,您特意导入每个框架的标题,并具体链接到每个框架。

SDK到iOS SDK,取出Cocoa.framework并导入Cocoa.h,并添加Foundation和UIKit(以及您需要的任何其他框架)并导入其头文件。

So, after you change the SDK from a Mac SDK to an iOS SDK, take out Cocoa.framework and the import of Cocoa.h, and add Foundation and UIKit (and any other frameworks you need) and import their headers.

Colloquy中心有两个项目:一个用于Mac OS X,其他的iOS。确保你打开并尝试建立正确的项目。

There are two projects in the Colloquy trunk: One for Mac OS X, the other for iOS. Make sure you're opening and trying to build the right project.

如果你有意尝试构建Mac项目,那是什么失败,请确保你有必要的Mac SDK安装。检查项目的构建设置,以查看其项目使用的那个,然后从Xcode磁盘映像安装它。 (如果你通过MAS安装Xcode,我不知道什么,如果有什么,你需要做。)

If you are intentionally trying to build the Mac project, and that's what's failing, make sure you have the necessary Mac SDK installed. Examine the project's build settings to see which one their project uses, then install it from your Xcode disk image. (If you installed Xcode via the MAS, I don't know what, if anything, you'll need to do.)

这篇关于找不到Cocoa / Cocoa.h(错误)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆