为什么我得到这个clang错误:在iOS 8的模拟器上_fwrite $ UNIX2003 [英] Why am i getting this clang error: _fwrite$UNIX2003 on simulator with iOS 8

查看:247
本文介绍了为什么我得到这个clang错误:在iOS 8的模拟器上_fwrite $ UNIX2003的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将新的iOS 8下载到我的手机和最新的Xcode到我的Mac上。这一切都运行正常,但在我尝试iPhone 4s或5个模拟器(它与5s一起工作)加载并尝试新的iPhone 6 plus模拟器后,我收到以下错误:

I have downloaded the new iOS 8 into both my phone and the latest Xcode onto my Mac. It all works fine but after loading up and trying the new iPhone 6 plus simulator when I try the iPhone 4s or 5 simulators (it works with 5s) I get the following error:

Undefined symbols for architecture i386:
  "_fwrite$UNIX2003", referenced from:
      leveldb::(anonymous namespace)::PosixEnv::~PosixEnv() in Firebase(env_posix.o)
      leveldb::(anonymous namespace)::PosixEnv::~PosixEnv() in Firebase(env_posix.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

对我而言,我整个上午都在使用iPhone 4模拟器似乎很奇怪,但只有在我尝试使用iPhone 6 plus模拟器后,它才会中断,我无法恢复使用

It seems very odd to me that I have been using the iPhone 4 simulator all morning but it is only after I try the iPhone 6 plus simulator that it breaks and I can't get its usage back

推荐答案

这个链接对我来说很好。

按照上面的链接,
为了消除所有这些错误,你必须创建一个* .c文件(不需要特定名称)并复制粘贴以下代码:

As per above link , In order to remove all of these error you have to create a *.c file (doesn't need a specific name) and copy paste the bellow code:

#include <stdio.h> 
#include <unistd.h> 
#include <string.h>
#include <stdlib.h>

FILE *fopen$UNIX2003( const char *filename, const char *mode )
{
    return fopen(filename, mode);
}

int fputs$UNIX2003(const char *res1, FILE *res2){
    return fputs(res1,res2);
}

int nanosleep$UNIX2003(int val){
    return usleep(val);
}

char* strerror$UNIX2003(int errornum){
    return strerror(errornum);
}

double strtod$UNIX2003(const char *nptr, char **endptr){
    return strtod(nptr, endptr);
}

size_t fwrite$UNIX2003( const void *a, size_t b, size_t c, FILE *d )
{
    return fwrite(a, b, c, d);
}

通常一切都应该没问题。

normally everything should be ok.

这篇关于为什么我得到这个clang错误:在iOS 8的模拟器上_fwrite $ UNIX2003的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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