Block_copy 丢失
我有一个 Xcode 项目,其中包含 OpenFeint 作为依赖项。 OpenFeint 有一个类对 Block_copy()
进行了两次调用,并对 Block_release()
进行了一次调用。一切都很顺利(例如,我多次构建并运行该项目,没有发生任何事件),直到编译器突然开始抱怨这些函数不存在。这实际上是在两个构建之间发生的,中间没有对源代码进行任何更改。
我不知道这些函数可能去了哪里,但我尝试通过提供一些占位符函数原型来解决它,如下所示:
extern void* Block_copy(const void *aBlock);
extern void Block_release(const void *aBlock);
我不确定这些是否是正确的签名(有关此主题的文档很少,充其量),但这是我能找到的最接近的。遗憾的是,这只会导致链接器而不是编译器抱怨。
那么有什么想法吗?我的整个开发环境都搞砸了吗?如果没有,我该如何让它再次工作?
I have an Xcode project which includes OpenFeint as a dependency. OpenFeint has one class that makes two calls to Block_copy()
and one call to Block_release()
. All was well (as in, I built and ran the project a number of times without incident) until suddenly the compiler started complaining that these functions don't exist. The thing literally broke in between two builds, with no changes to the source code in between.
I have no idea where these functions could have gone, but I've attempted to work around it by providing some placeholder function prototypes, like so:
extern void* Block_copy(const void *aBlock);
extern void Block_release(const void *aBlock);
I'm not sure if those are the correct signatures (the documentation on this topic is sparse, at best), but it's the closest I've been able to find. Sadly, this just causes the linker to complain instead of the compiler.
So any ideas? Is my whole development environment screwed? If not, how do I get it working again?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Block_copy的实际定义在
/Developer/SDKs/MacOSX10.6.sdk/usr/include/Block.h
并读取
#define Block_copy(...) ((__typeof(__VA_ARGS__))_Block_copy((const void *)(__VA_ARGS__)))
和 _Block_copy 在同一文件中定义为
BLOCK_EXPORT void *_Block_copy(const void *aBlock);
提供您自己的定义对 Xcode 没有帮助。你的 XCode 目标改变了吗?
The actual definition of Block_copy is in
/Developer/SDKs/MacOSX10.6.sdk/usr/include/Block.h
and reads
#define Block_copy(...) ((__typeof(__VA_ARGS__))_Block_copy((const void *)(__VA_ARGS__)))
and _Block_copy is defined in the same file by
BLOCK_EXPORT void *_Block_copy(const void *aBlock);
Providing your own definition will not help Xcode. Has your target in XCode changed ?
临时解决方法是将“Block.h”的全部内容内联到 OpenFeint 源文件中。奇怪的是,尝试
#include
或#import
文件不起作用,这可能是问题的全部。无论如何,该文件应存在于
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator[VERSION].sdk/usr/include/Block.h
中,内容应为:A temporary workaround is to inline the entire contents of 'Block.h' in the OpenFeint source file. Strangely, trying to
#include
or#import
the file does not work, which may be the whole of the problem.In any case, this file should exist at
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator[VERSION].sdk/usr/include/Block.h
, and the contents should be:你是否切换了 XCode 或者 iOS(暗示最近为开发人员发布了一些东西)。如果您意外切换到 ARC,这些功能可能不再存在(ARC 不受 NDA 保护,因为它已经存在并且是开源的)。
Did you switch XCode or perhaps iOS (hinting at something recently released for developers). It might be that, if you switched to ARC accidentally, those functions may no longer exist (ARC isn't under NDA since it already existed and is open source).