FOPEN $ UNIX2003外部库中失败 [英] fopen$UNIX2003 fails inside external library

查看:147
本文介绍了FOPEN $ UNIX2003外部库中失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用的fopen来访问文件系统上的文件的外部静态库(我源$ C ​​$ C以及)。奇怪的是,它总是失败无论在模拟器和设备时,它试图用 EXE_BAD_ACCESS 这样做在的fopen $ UNIX2003 (不是的fopen 的fopen 甚至没有在调用堆栈时,会抛出异常。我已经试过使用的fopen 直接自己用相同的路径/选项和它的作品。所以,首先,是有可能,该库以某种方式调用不同的 FOPEN 实施?如​​果是这样,为什么,最重要的我怎么可以把它称之为'正确'的?

I have an external static library (I have the source code as well) that uses 'fopen' to access files on the filesystem. The strange thing is that it always fails both on simulator and device when it tries to do so with EXE_BAD_ACCESS inside fopen$UNIX2003 (not in fopen, fopen is not even in the call stack when the exception is thrown. I've tried to use fopen directly myself with the same path/options and it works. So, first of all, is it possible that the library is somehow calling a different fopen implementation? If so, why, and most important how can I make it call the 'right' one?

编辑:其实,在调用堆栈中的最后一个函数之前抛出异常是 _interposition_vtable_unimplemented 的fopen $ UNIX2003 precedes它。

Actually, the last function in the call stack before the exception is thrown is _interposition_vtable_unimplemented, fopen$UNIX2003 precedes it.

推荐答案

$的fopen UNIX2003是由OS X提供,不是iPhone模拟器运行时的一部分的象征。 iOS版的总是的一致性,因此不具有传统的功能(非$ UNIX2003)变种(其中提供了内置老版本的OS X SDK的code二进制兼容性)。

fopen$UNIX2003 is a symbol that is provided by OS X and is not part of the iOS Simulator runtime. iOS is always conformant and thus does not have legacy (non $UNIX2003) variants of functions (which are provided for binary compatibility with code built against older versions of the OS X SDK).

您所看到的问题的常见原因是,你有一个建针对OS X SDK目标文件或存档(libsomething.a),并试图将其链接到您的iOS模拟器可执行文件。不支持的两个平台是不是二进制在这一层都兼容。

The common cause of the issue you are seeing is that you have an object file or archive (libsomething.a) that was built against the OS X SDK and are trying to link it into your iOS Simulator executable. That is not supported as the two platforms are not binary compatible at that layer.

您需要重建库(该libsomething.a)针对iPhone模拟器SDK。

You need to rebuild your library (the libsomething.a) against the iOS Simulator SDK.

这个问题导致中止在运行在iOS 7,但现在在iOS上的8编译时间链接错误,这似乎已经让这些问题更加明显。

This problem results in an abort at runtime on iOS 7 but is now a link error at build time on iOS 8, and that seems to have helped make these issues much more obvious.

这篇关于FOPEN $ UNIX2003外部库中失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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